* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 10px;
}

.container { max-width: 1100px; margin: 0 auto; }

.header { text-align: center; margin: 16px 0 24px; }
.header h1 { font-size: 2rem; color: #10b981; text-shadow: 0 2px 4px rgba(0,0,0,.3); }
.header .subtitle { color: #94a3b8; font-size: .9rem; margin-top: 4px; }

.card {
    background: rgba(30, 41, 59, .8);
    border: 1px solid #334155;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.card h3 { color: #10b981; margin-bottom: 15px; font-size: 1.15rem; }

.centered-card { max-width: 420px; margin: 60px auto; text-align: center; }
.centered-card p { color: #cbd5e1; margin: 12px 0 20px; line-height: 1.5; }

button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff; border: none; padding: 12px 20px; border-radius: 8px;
    cursor: pointer; font-size: 15px; font-weight: 600; transition: all .2s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(16,185,129,.4); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

button.secondary { background: #334155; }
button.danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
button.small { padding: 7px 12px; font-size: 13px; }

.google-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background: #fff; color: #1f2937; font-weight: 600;
    padding: 12px 24px; border-radius: 8px; font-size: 15px;
}
.google-btn:hover { box-shadow: 0 5px 15px rgba(255,255,255,.2); }
.google-btn svg { width: 20px; height: 20px; }

label { display: block; margin-bottom: 5px; color: #cbd5e1; font-weight: 500; }
input, select {
    width: 100%; padding: 12px; border: 2px solid #334155; border-radius: 8px;
    background: #1e293b; color: #e2e8f0; font-size: 16px;
}
input:focus, select:focus { outline: none; border-color: #10b981; }
.form-group { margin-bottom: 15px; text-align: left; }

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(30,41,59,.8); border: 1px solid #334155;
    border-radius: 10px; padding: 10px 16px; margin-bottom: 20px;
    flex-wrap: wrap; gap: 8px;
}
.topbar .who { color: #cbd5e1; font-size: .95rem; }
.topbar .who .name { color: #10b981; font-weight: 700; }
.topbar .who .role-badge {
    background: #10b981; color: #052e22; font-size: .7rem; font-weight: 800;
    border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: middle;
}
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav button { background: transparent; border: 1px solid #334155; color: #cbd5e1; padding: 8px 14px; }
.topbar nav button.active { background: #10b981; color: #052e22; border-color: #10b981; }

.list-item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: rgba(15,23,42,.6); border: 1px solid #334155;
    border-radius: 10px; padding: 12px 15px; margin-bottom: 10px; flex-wrap: wrap;
}
.list-item .title { font-weight: 700; }
.list-item .meta { color: #94a3b8; font-size: .85rem; }
.list-item .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
    display: inline-block; border-radius: 999px; padding: 2px 10px;
    font-size: .75rem; font-weight: 700;
}
.pill.live { background: #10b981; color: #052e22; }
.pill.settled { background: #334155; color: #cbd5e1; }
.pill.pending { background: #f59e0b; color: #451a03; }

.suggestions { width: 100%; margin-top: 8px; }
.suggestion {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(16,185,129,.08); border: 1px solid #10b98144;
    border-radius: 8px; padding: 8px 12px; margin-top: 6px; font-size: .9rem;
}
.suggestion .match { color: #94a3b8; font-size: .8rem; }

.empty { color: #64748b; text-align: center; padding: 18px 0; }

.scroll-list { max-height: 340px; overflow-y: auto; }
.scroll-list::-webkit-scrollbar { width: 8px; }
.scroll-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.row-click { cursor: pointer; }
.row-click:hover td { background: rgba(16,185,129,.06); }

.stat-tiles {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.stat-tile {
    background: rgba(15,23,42,.6); border: 1px solid #334155;
    border-radius: 10px; padding: 12px 14px;
}
.stat-tile .label { color: #94a3b8; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-tile .value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.stat-tile .sub { color: #94a3b8; font-size: .8rem; margin-top: 2px; }

.chart-wrap { position: relative; height: 260px; }
.filter-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-row select { width: auto; min-width: 160px; padding: 8px 12px; font-size: 14px; }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center; z-index: 50;
    padding: 15px;
}
.modal-box {
    background: #1e293b; border: 1px solid #334155; border-radius: 15px;
    padding: 24px; width: 100%; max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-box h3 { color: #10b981; margin-bottom: 15px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button { flex: 1; }
.chips-toggle { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: .9rem; }

.game-table { width: 100%; border-collapse: collapse; }
.game-table th {
    text-align: left; color: #94a3b8; font-size: .8rem; font-weight: 600;
    padding: 6px 8px; border-bottom: 1px solid #334155;
}
.game-table td { padding: 9px 8px; border-bottom: 1px solid #1e293b; }
.game-table td.num, .game-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.game-table .me { color: #10b981; font-weight: 700; }
.game-table .total-row td { border-top: 2px solid #475569; border-bottom: none; font-weight: 700; }
.profit-pos { color: #10b981; }
.profit-neg { color: #ef4444; }
.error-banner {
    background: #7f1d1d; border: 1px solid #ef4444; color: #fecaca;
    border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; display: none;
}
.muted { color: #94a3b8; font-size: .85rem; }
#gameStats { color: #e2e8f0; font-size: 1.1rem; font-weight: 600; margin-top: 4px; }
#insuranceFee { color: #f59e0b; }  /* 保费 = 要付的钱，醒目一点 */
.hidden { display: none !important; }

@media (max-width: 600px) {
    .topbar { flex-direction: column; align-items: stretch; }
    .list-item { flex-direction: column; align-items: flex-start; }
}
