*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family: system-ui,-apple-system,Segoe UI,Roboto;
}
body{
    background: #cfe2f8;
    color:#2c3e58;
    min-height:100vh;
    padding:30px 16px;
    position: relative;
    overflow-x: hidden;
}
/* 雪花：放在最底层，z-index:1，毛玻璃可以穿透看到雪花 */
.snow-container {
    position: fixed;
    inset:0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.snow {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0.75;
    animation: fall linear infinite;
}
@keyframes fall {
    0% {
        transform: translateY(-10px) translateX(-15px) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) translateX(15px) rotate(360deg);
    }
}
/* 页面内容整体在雪花上层 z‑index:2 */
.wrap{
    max-width:720px;
    margin:0 auto;
    position: relative;
    z-index: 2;
}
.header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:36px;
}
.title{
    display:flex;
    align-items:center;
    gap:14px;
}
.logo-circle{
    width:52px;
    height:52px;
    border-radius:50%;
    background:rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border:1px solid rgba(255,255,255,0.4);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    transition: 0.3s ease;
}
.logo-circle:hover{
    transform: scale(1.04);
    box-shadow: 0 0 10px rgba(80,140,220,0.3);
}
.logo-icon{
    width:100%;
    height:100%;
    object-fit:cover;
}
.title-text h1{
    font-size:38px;
    color:#2964b9;
    letter-spacing:1px;
    line-height:1.1;
}
.title-text p{
    color:#4b6588;
    margin-top:6px;
    font-size:16px;
}
.rule-btn{
    background:rgba(255,255,255,0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border:1px solid rgba(255,255,255,0.4);
    color:#2964b9;
    padding:11px 22px;
    border-radius:999px;
    font-size:16px;
    cursor:pointer;
    transition:0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.rule-btn:hover{
    background:rgba(255,255,255,0.45);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 14px rgba(40,90,170,0.12);
}
.top3-wrap{
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:12px;
    margin-bottom:30px;
    align-items:end;
}
/* 液态玻璃卡片，透过它可以看到下层雪花 */
.top-item{
    background:rgba(255,255,255,0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border:1px solid rgba(255,255,255,0.35);
    border-radius:20px;
    padding:18px 14px 14px;
    text-align:center;
    transition:0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:0 4px 15px rgba(40,90,170,0.08);
    display:flex;
    flex-direction:column;
}
.top-item:hover{
    transform:translateY(-5px) scale(1.015);
    background:rgba(255,255,255,0.38);
    border-color:rgba(255,255,255,0.6);
    box-shadow:0 10px 24px rgba(40,90,170,0.16);
}
.top-item:nth-child(1){ transform:translateY(12px); }
.top-item:nth-child(1):hover{ transform:translateY(7px) scale(1.015); }

.top-item:nth-child(2){
    transform:translateY(-10px);
    background:rgba(255,255,255,0.3);
    border-color:rgba(255,255,255,0.45);
}
.top-item:nth-child(2):hover{ transform:translateY(-14px) scale(1.015); }

.top-item:nth-child(3){ transform:translateY(8px); }
.top-item:nth-child(3):hover{ transform:translateY(3px) scale(1.015); }

.avatar-circle{
    width:72px;
    height:72px;
    border-radius:50%;
    background:rgba(255,255,255,0.25);
    margin:0 auto 12px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,0.35);
    transition: 0.35s ease;
}
.top-item:hover .avatar-circle{
    transform: scale(1.04);
    box-shadow: 0 0 12px rgba(80,140,220,0.3);
}
.avatar-circle img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.top-name{
    font-size:18px;
    font-weight:600;
    color:#2c3e58;
    transition:0.35s ease;
}
.top-item:hover .top-name{
    text-shadow: 0 0 8px rgba(255,255,255,0.6);
    transform: translateY(-1px);
}
.top-time{
    font-size:21px;
    color:#2964b9;
    margin-top:6px;
    font-weight:bold;
    transition:0.35s ease;
}
.top-item:hover .top-time{
    text-shadow:0 0 10px rgba(80,140,220,0.4);
    transform: translateY(-1px);
}
.top-emoji{
    font-size:28px;
    margin-top:auto;
    padding-top:10px;
    transition:0.35s ease;
}
.top-item:hover .top-emoji{
    transform: translateY(-2px) scale(1.06);
}
/* 前三名特殊配色：金/银/铜（开关开启时 top3-wrap 带 .special） */
.top3-wrap.special .top-item:nth-child(2){
    background:linear-gradient(160deg,rgba(255,215,0,.55),rgba(255,180,20,.25));
    border-color:rgba(255,205,70,.85);
    box-shadow:0 6px 20px rgba(230,180,40,.25);
}
.top3-wrap.special .top-item:nth-child(1){
    background:linear-gradient(160deg,rgba(205,212,225,.55),rgba(160,175,195,.28));
    border-color:rgba(210,218,230,.8);
}
.top3-wrap.special .top-item:nth-child(3){
    background:linear-gradient(160deg,rgba(214,138,68,.5),rgba(180,105,45,.28));
    border-color:rgba(220,150,80,.8);
}

.list-item{
    background:rgba(255,255,255,0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border:1px solid rgba(255,255,255,0.35);
    border-radius:16px;
    display:flex;
    align-items:center;
    padding:16px 20px;
    margin-bottom:12px;
    gap:16px;
    min-height:64px;
    transition:0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.list-item:hover{
    transform: translateY(-4px) scale(1.01);
    border-color:rgba(255,255,255,0.6);
    background:rgba(255,255,255,0.38);
    box-shadow: 0 8px 20px rgba(40,90,170,0.14);
}

.list-rank{
    width:38px;
    height:38px;
    border-radius:50%;
    background:rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border:1px solid rgba(255,255,255,0.35);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    font-size:17px;
    color:#2964b9;
    flex-shrink:0;
    transition:0.35s ease;
}
.list-item:hover .list-rank{
    transform: scale(1.06);
    box-shadow: 0 0 10px rgba(80,140,220,0.35);
}

.list-avatar{
    width:48px;
    height:48px;
    border-radius:50%;
    background:rgba(255,255,255,0.25);
    border:1px solid rgba(255,255,255,0.35);
    overflow:hidden;
    flex-shrink:0;
    transition:0.35s ease;
}
.list-item:hover .list-avatar{
    transform: scale(1.04);
}
.list-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.list-name{
    font-size:18px;
    color:#2c3e58;
    transition:0.35s ease;
}
.list-item:hover .list-name{
    transform: translateX(2px);
    text-shadow:0 0 6px rgba(255,255,255,0.55);
}
.list-time{
    font-size:21px;
    color:#2964b9;
    font-weight:bold;
    margin-left:auto;
    transition:0.35s ease;
}
.list-item:hover .list-time{
    transform: translateX(-2px);
    text-shadow:0 0 8px rgba(80,140,220,0.4);
}

.empty-tip{
    text-align:center;
    padding:90px 0;
    color:#4b6588;
    font-size:17px;
    background:rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    border-radius:16px;
}
.mask{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.18); /* 原来0.35，降低透明度，不那么灰 */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:999;
}
.rule-box{
    background: rgba(255,255,255,0.55); /* 调高白色透明度，提亮弹窗 */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius:24px;
    width:100%;
    max-width:540px;
    padding:32px 30px 28px;
    max-height:72vh;
    overflow:auto;
    color:#2c3e58;
    position:relative;
    border:1px solid rgba(255,255,255,0.65);
    animation: pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.rule-box h3{
    margin-bottom:18px;
    font-size:22px;
    font-weight:600;
    color:#2964b9;
    display:flex;
    align-items:center;
    gap:8px;
}
.rule-content{
    line-height:1.82;
    white-space:pre-wrap;
    color:#3c4e68;
    font-size:15px;
    background:rgba(255,255,255,0.18);
    border-radius:16px;
    padding:18px;
    border:1px solid rgba(255,255,255,0.3);
}
.close-btn{
    margin-top:24px;
    width:100%;
    border:none;
    padding:14px;
    border-radius:14px;
    background:rgba(41,100,185,0.75);
    color:#ffffff;
    font-weight:600;
    font-size:16px;
    cursor:pointer;
    transition:0.26s;
}
.close-btn:hover{
    background:rgba(41,100,185,0.9);
    transform:translateY(-2px);
}
@keyframes pop{
    from{
        transform:scale(0.88) translateY(10px);
        opacity:0;
    }
    to{
        transform:scale(1) translateY(0);
        opacity:1;
    }
}

/* 前三名：浅色底上的柔和金属卡片 */
.top-item.top-gold{
    background:linear-gradient(160deg,#fff8d6 0%,#ffe9a0 60%,#ffd966 100%) !important;
    border:2px solid #e8b923 !important;
    box-shadow:0 6px 18px rgba(232,185,35,.3) !important;
}
.top-item.top-gold .top-name{ color:#7a5a05 !important; }
.top-item.top-gold .top-time{ color:#b8860b !important; }
.top-item.top-silver{
    background:linear-gradient(160deg,#f7f9fc 0%,#e2e8f0 60%,#c8d2de 100%) !important;
    border:2px solid #aebdcf !important;
    box-shadow:0 6px 18px rgba(150,165,185,.3) !important;
}
.top-item.top-silver .top-name{ color:#3d4a5c !important; }
.top-item.top-silver .top-time{ color:#5a6b80 !important; }
.top-item.top-bronze{
    background:linear-gradient(160deg,#fbe3cd 0%,#e8b487 60%,#cc8850 100%) !important;
    border:2px solid #b0703a !important;
    box-shadow:0 6px 18px rgba(176,112,58,.3) !important;
}
.top-item.top-bronze .top-name{ color:#5c3a18 !important; }
.top-item.top-bronze .top-time{ color:#8b5a2b !important; }

/* ===== 深色模式 ===== */
body.dark{
    background:#121826;
    color:#e6edf7;
}
body.dark .title-text h1{ color:#7ab3ff; }
body.dark .title-text p{ color:#9aa8c0; }
body.dark .rule-btn{
    background:rgba(255,255,255,.08);
    border-color:rgba(255,255,255,.15);
    color:#7ab3ff;
}
body.dark .logo-circle{ background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.15); }
body.dark .empty-tip{ color:#8892b0; }
body.dark .list-item,
body.dark .top-item{
    background:rgba(255,255,255,.06) !important;
    border-color:rgba(255,255,255,.1) !important;
    box-shadow:none !important;
}
body.dark .list-item:hover,
body.dark .top-item:hover{ background:rgba(255,255,255,.1) !important; }
body.dark .list-rank{ background:rgba(255,255,255,.08); color:#cbd5e1; }
body.dark .list-name, body.dark .top-name{ color:#e6edf7 !important; }
body.dark .list-time, body.dark .top-time{ color:#7ab3ff !important; }
body.dark .mask{ background:rgba(0,0,0,.6); }
body.dark .rule-box{ background:#1a2233; border-color:rgba(255,255,255,.08); }
body.dark .tab-btn{ background:rgba(255,255,255,.06); color:#cbd5e1; }
body.dark .tab-btn.active{ background:#2563eb; color:#fff; }
body.dark .rule-content{ color:#cbd5e1; }
body.dark .form-row input{
    background:rgba(255,255,255,.06);
    border-color:rgba(255,255,255,.12);
    color:#fff;
}
body.dark .form-row input::placeholder{ color:rgba(255,255,255,.35); }
body.dark .qr-line{ background:rgba(255,255,255,.06); color:#e6edf7; }
body.dark .qr-line.title{ background:rgba(122,179,255,.12); }
body.dark .qr-line.ok{ background:rgba(126,226,168,.15); }
body.dark .qr-line.warn{ background:rgba(255,196,0,.15); }
body.dark .qr-line.err{ background:rgba(255,90,90,.18); }
body.dark .mini-tip{ color:#9aa8c0; }
/* 主题切换按钮 */
#themeToggle{
    position:fixed;top:16px;right:16px;z-index:99;
    width:42px;height:42px;border-radius:50%;
    border:1px solid rgba(255,255,255,.3);
    background:rgba(255,255,255,.25);
    backdrop-filter:blur(8px);
    cursor:pointer;font-size:20px;
    display:flex;align-items:center;justify-content:center;
}
body.dark #themeToggle{ background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.15); }

/* ===== 移动端适配 ===== */
@media(max-width:768px){
    body{ padding-bottom:env(safe-area-inset-bottom); }
    .header{ flex-wrap:wrap; gap:4px 8px; margin-bottom:12px !important; padding:0 4px; align-items:flex-start; }
    .header .title{ flex:1 1 auto; min-width:0; }
    .title-text h1{ font-size:22px !important; white-space:nowrap; }
    .title-text p{ font-size:12px !important; white-space:nowrap; }
    .logo-circle{ width:40px !important; height:40px !important; flex-shrink:0; }
    #lastUpdateTip{ width:auto !important; font-size:11px !important; margin-left:auto; align-self:flex-end; }
    .rule-btn{ padding:8px 12px !important; font-size:12px !important; white-space:nowrap; flex-shrink:0; margin-left:auto; align-self:flex-start; }

    .top3-row{ flex-direction:column !important; align-items:center !important; gap:12px !important; padding:0 12px !important; }
    .top3-card{ width:100% !important; max-width:320px !important; }

    .rank-item{ padding:10px 12px !important; gap:10px !important; }
    .rank-num{ width:28px !important; height:28px !important; font-size:13px !important; }
    .rank-name{ font-size:14px !important; }
    .rank-time{ font-size:15px !important; }

    .modal-box{ width:94% !important; max-height:88vh !important; padding:16px !important; border-radius:16px !important; }
    .tab-bar{ flex-wrap:wrap; gap:6px !important; }
    .tab-btn{ flex:1 1 calc(50% - 6px); padding:10px 8px !important; font-size:13px !important; white-space:nowrap; }
    .form-row{ margin-bottom:10px !important; }
    .form-row input{ padding:12px !important; font-size:16px !important; width:100% !important; box-sizing:border-box; }
    .time-row{ gap:8px !important; }
    .time-row input{ font-size:18px !important; }
    button{ font-size:15px !important; padding:13px !important; width:100% !important; }

    #themeToggle{ position:static !important; width:36px !important; height:36px !important; font-size:16px !important; flex-shrink:0; margin-left:4px; }

    .close-btn{ width:100% !important; }
    .query-result{ font-size:13px !important; }
    .list-avatar,.top-avatar{ width:36px !important; height:36px !important; }
}

.header-right{ display:flex; align-items:center; gap:6px; }
@media(max-width:768px){
    .header-right{ margin-left:auto; align-self:flex-start; }
    #themeToggle{ position:static !important; margin-left:0 !important; }
    .rule-btn{ margin-left:0 !important; }
}

#rowAvatarUrl .flex{ display:flex; gap:6px; align-items:stretch; }
#rowAvatarUrl input{ flex:1; min-width:0; }
#uploadAvatarBtn{ width:auto !important; flex-shrink:0; white-space:nowrap; }
@media(max-width:768px){
    #rowAvatarUrl input{ font-size:14px !important; padding:12px 10px !important; }
    #uploadAvatarBtn{ font-size:13px !important; padding:12px 10px !important; }
}
