﻿:root {
    --bg0: #070b14;
    --bg1: #0b1220;
    --card: rgba(255,255,255,.06);
    --card2: rgba(255,255,255,.08);
    --stroke: rgba(255,255,255,.12);
    --text: #eaf0ff;
    --muted: rgba(234,240,255,.72);
    --muted2: rgba(234,240,255,.52);
    --brand: #7c5cff;
    --brand2: #30d5c8;
    --good: #37d67a;
    --warn: #ffb020;
    --danger: #ff5c7a;
    --shadow: 0 18px 40px rgba(0,0,0,.45);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "PingFang SC","Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(124,92,255,.08), transparent 28%), radial-gradient(circle at top right, rgba(48,213,200,.06), transparent 24%), var(--bg1);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 14px 14px 18px;
}

/* hero */
.hero {
    border: 1px solid var(--stroke);
    background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(48,213,200,.10));
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 12% 18%, rgba(255,255,255,.10), transparent 18%), radial-gradient(circle at 88% 0%, rgba(255,255,255,.08), transparent 22%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    padding: 14px 14px 12px;
}

.brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.brand-left {
    min-width: 0;
}

.brand h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: .2px;
}

.brand p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.mini-chip {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(0,0,0,.10);
    color: rgba(234,240,255,.82);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    box-shadow: 0 0 0 4px rgba(255,255,255,.06);
}

/* stats */
.stats {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
}

.stat {
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.10);
    padding: 10px 10px;
    min-width: 0;
}

.stat .k {
    color: rgba(234,240,255,.60);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stat .v {
    margin-top: 6px;
    font-weight: 950;
    letter-spacing: .2px;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat .v.low {
    color: var(--good);
}

.stat .v.high {
    color: var(--danger);
}

.stat .v.neutral {
    color: rgba(234,240,255,.96);
}

/* tabs */
.tabs {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
}

.tabs::-webkit-scrollbar {
    height: 8px;
}

.tabs::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 999px;
}

.tabs::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(124,92,255,.9), rgba(48,213,200,.85));
    border-radius: 999px;
}

.tab {
    flex: 0 0 auto;
    min-width: 106px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.10);
    padding: 10px 10px;
    cursor: pointer;
    user-select: none;
    transition: .18s ease;
}

.tab.active {
    background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(48,213,200,.12));
    border-color: rgba(255,255,255,.18);
}

.tab .d {
    font-weight: 900;
    font-size: 13px;
    white-space: nowrap;
}

.tab .s {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(234,240,255,.66);
    font-size: 12px;
}

.tab .pill {
    padding: 3px 8px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.80);
    font-size: 11px;
    white-space: nowrap;
}

/* actions */
.common-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.92);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: .2s ease;
}

.action-btn:hover {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.20);
}

.action-btn.primary {
    background: linear-gradient(135deg, rgba(124,92,255,.28), rgba(48,213,200,.18));
    border-color: rgba(124,92,255,.40);
    box-shadow: 0 10px 24px rgba(124,92,255,.18);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, rgba(124,92,255,.36), rgba(48,213,200,.22));
}

/* filter */
.filter {
    margin-top: 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.10));
    box-shadow: 0 12px 30px rgba(0,0,0,.26);
    overflow: hidden;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
    padding: 12px;
}

.filter select {
    width: 100%;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--text);
    padding: 0 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.filter select option {
    background: #101827;
    color: #eaf0ff;
}

/* list */
.list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match {
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.10));
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    overflow: hidden;
    position: relative;
    transition: .18s ease;
}

.match:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,.16);
}

.match.low-cost {
    border-color: rgba(55,214,122,.38);
    box-shadow: 0 0 0 1px rgba(55,214,122,.10), 0 12px 30px rgba(0,0,0,.35);
}

.match.high-cost {
    border-color: rgba(255,92,122,.28);
}

.match:active {
    transform: scale(.996);
}

.match-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 10px;
}

.left {
    min-width: 0;
    flex: 1;
}

.topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.jid {
    letter-spacing: .3px;
    font-size: 12px;
    padding: 4px 0;
    color: var(--muted);
}

.date {
    color: rgba(234,240,255,.70);
    font-size: 12px;
}

.league {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(234,240,255,.88);
    font-size: 12.5px;
    font-weight: 850;
}

.l-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255,255,255,.06);
    flex: 0 0 auto;
}

.teams {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1.25;
}

.teams .vs {
    padding: 4px 6px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.72);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}

.teams .t {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teams .t.away {
    text-align: right;
}

.right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: 38%;
}

.status {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.82);
    white-space: nowrap;
    font-weight: 800;
}

.badge.low {
    border-color: rgba(55,214,122,.30);
    background: rgba(55,214,122,.12);
    color: rgba(220,255,235,1);
}

.badge.mid {
    border-color: rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
}

.badge.high {
    border-color: rgba(255,92,122,.28);
    background: rgba(255,92,122,.10);
    color: rgba(255,220,228,1);
}

.badge.down {
    border-color: rgba(55,214,122,.30);
    background: rgba(55,214,122,.10);
    color: rgba(220,255,235,1);
}

.badge.up {
    border-color: rgba(255,176,32,.34);
    background: rgba(255,176,32,.10);
    color: rgba(255,236,206,1);
}

/* odds */
.odds-panel {
    margin: 0 12px 12px;
    border-top: 1px solid rgba(255,255,255,.10);
    padding-top: 10px;
}

.odds-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.odd-card {
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.10));
    padding: 10px 10px;
    min-width: 0;
}

.odd-card .k {
    color: rgba(234,240,255,.62);
    font-size: 12px;
}

.odd-card .v {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 950;
    letter-spacing: .2px;
    white-space: nowrap;
}

.odd-card .p {
    margin-top: 5px;
    color: rgba(234,240,255,.56);
    font-size: 11px;
}

/* cost summary */
.cost-summary {
    margin: 0 12px 12px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(48,213,200,.10)), rgba(255,255,255,.04);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.cost-box {
    min-width: 0;
}

.cost-box .k {
    color: rgba(234,240,255,.66);
    font-size: 12px;
}

.cost-box .v {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 950;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cost-box .v.low {
    color: var(--good);
}

.cost-box .v.high {
    color: var(--danger);
}

.cost-box .v.down {
    color: var(--good);
}

.cost-box .v.up {
    color: var(--warn);
}

.cost-box .tip {
    margin-top: 5px;
    color: rgba(234,240,255,.54);
    font-size: 11px;
}

.card-actions {
    margin: 0 12px 12px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.card-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: rgba(234,240,255,.92);
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: .18s ease;
}

.card-btn:hover {
    background: rgba(255,255,255,.10);
}

.card-btn.primary {
    background: linear-gradient(135deg, rgba(124,92,255,.24), rgba(48,213,200,.14));
    border-color: rgba(124,92,255,.35);
}

/* empty */
.empty {
    text-align: center;
    color: rgba(234,240,255,.60);
    font-size: 13px;
    padding: 18px 12px;
    border: 1px dashed rgba(255,255,255,.16);
    border-radius: var(--radius);
    background: rgba(0,0,0,.10);
}

/* footer */
.site-footer {
    margin-top: 22px;
    padding: 18px 12px calc(22px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    color: rgba(234,240,255,.55);
}

.footer-inner {
    max-width: 980px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.8;
}

.footer-links a {
    color: rgba(234,240,255,.70);
    text-decoration: none;
    padding: 2px 4px;
}

.footer-links a:hover {
    color: rgba(234,240,255,.95);
}

.footer-links .sep {
    opacity: .35;
}

.footer-meta {
    margin-top: 10px;
    line-height: 1.6;
}

.footer-meta .slogan {
    margin-top: 4px;
    font-size: 11px;
    opacity: .65;
}

/* back to top */
#backToTop {
    position: fixed;
    right: 24px;
    bottom: 32px;
    width: 44px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(120, 160, 255, 0.25);
    color: #9fb6ff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 rgba(255, 255, 255, 0);
    font-size: 20px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease, box-shadow 0.25s ease;
}

#backToTop.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#backToTop:hover {
    background: rgba(120, 160, 255, 0.18);
    box-shadow: 0 10px 28px rgba(80, 120, 255, 0.35), inset 0 0 12px rgba(120, 160, 255, 0.25);
    color: #dbe3ff;
}

/* dialog */
.simple-dialog {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
}

.simple-dialog.show {
    display: block;
}

.simple-dialog-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.56);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.simple-dialog-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 24px));
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(180deg, rgba(17,22,35,.98), rgba(11,18,32,.98));
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    overflow: hidden;
}

.simple-dialog-header,
.simple-dialog-footer {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.simple-dialog-header {
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.simple-dialog-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    justify-content: flex-end;
}

.simple-dialog-title {
    font-size: 16px;
    font-weight: 950;
    color: rgba(234,240,255,.96);
}

.simple-dialog-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(234,240,255,.72);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.simple-dialog-body {
    padding: 16px;
    color: rgba(234,240,255,.86);
    font-size: 13px;
    line-height: 1.8;
}

/* responsive */
@media (min-width: 720px) {
    .wrap {
        padding: 18px 18px 22px;
    }

    .brand h1 {
        font-size: 20px;
    }
}

@media (min-width: 721px) {
    .tabs {
        overflow-x: auto;
    }
}

@media (max-width: 760px) {
    .filter-row {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .cost-summary {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 640px) {
    .brand {
        flex-direction: column;
        align-items: stretch;
    }

    .mini-chip {
        width: fit-content;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .match-header {
        gap: 10px;
    }

    .right {
        max-width: 42%;
    }

    .teams {
        font-size: 13px;
    }

    .odds-grid {
        grid-template-columns: 1fr;
    }

    .cost-summary {
        grid-template-columns: 1fr;
    }

    .common-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .action-btn {
        text-align: center;
    }

    .card-actions {
        justify-content: stretch;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .card-btn {
        width: 100%;
        text-align: center;
    }
}
