:root{color-scheme:light;--bg:#f2f4fd;--card:#ffffff;--ink:#1e2a4a;--muted:#7a869e;--line:#e6e9f5;--blue:#2f6bff;--purple:#7c3aed;--purple2:#9333ea;--soft-purple:#f3e8ff;--soft-blue:#dbeafe;--shadow:0 4px 16px rgba(69,76,160,.07)}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}
body.dark{color-scheme:dark;--bg:#12152a;--card:#1e2338;--ink:#eef0ff;--muted:#9aa3c0;--line:#2e3350;--soft-purple:#2c2145;--soft-blue:#1d2c4d;--shadow:0 4px 16px rgba(0,0,0,.3)}
a{color:inherit;text-decoration:none}
small,.muted{color:var(--muted)}
.small{font-size:13px;margin:6px 0}
.center{text-align:center}
h2{font-size:17px;margin:0}
button,input{font:inherit;color:inherit;background:var(--card);border:1px solid var(--line);border-radius:10px;padding:9px 12px;max-width:100%}
button{cursor:pointer}
button:hover{border-color:var(--purple)}
button:disabled{opacity:.45;cursor:not-allowed}

/* 顶栏 */
.topbar{background:var(--card);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50}
.topbar nav{max-width:1280px;margin:auto;display:flex;align-items:center;gap:28px;padding:12px 24px}
.brand{font-size:24px;font-weight:800;color:var(--blue);display:flex;align-items:center;gap:6px;white-space:nowrap}
.brand .crown{font-size:28px;line-height:1}
.brand-tag{font-size:13px;font-weight:700;background:linear-gradient(110deg,var(--blue),var(--purple));color:#fff;border-radius:999px;padding:3px 10px}
.nav-links{display:flex;gap:4px;flex-wrap:wrap;margin-right:auto}
.nav-links a{padding:8px 14px;border-radius:999px;font-size:14px;color:#4b5568}
body.dark .nav-links a{color:#c3c9e0}
.nav-links a:hover{color:var(--purple)}
.nav-links a.active{background:var(--blue);color:#fff;font-weight:600}
.nav-actions{display:flex;align-items:center;gap:10px}
.icon-btn{border:1px solid var(--line);border-radius:50%;width:38px;height:38px;padding:0;display:grid;place-items:center;font-size:18px;background:var(--bg)}
.login-btn{background:linear-gradient(110deg,#8b5cf6,#7c3aed);color:#fff;font-weight:600;font-size:14px;padding:8px 22px;border-radius:999px}

/* 横幅 */
.hero{background:linear-gradient(115deg,#2f7df6,#5b5ff0 48%,#a855f7);color:#fff;padding:30px max(24px,calc((100vw - 1280px)/2));display:flex;justify-content:space-between;align-items:center;gap:24px;position:relative;overflow:hidden}
.hero-left{display:flex;align-items:center;gap:16px;position:relative;z-index:1}
.hero-badge{width:64px;height:64px;border-radius:18px;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.35);display:grid;place-items:center;font-size:36px}
.hero h1{font-size:34px;margin:0;line-height:1.2}
.hero h1 .chev{font-size:22px;opacity:.85}
.hero p{margin:8px 0 0;opacity:.92}
.hero-right{text-align:right;position:relative;z-index:1}
.hero-right h2{font-size:26px;margin:0}
.hero-right p{margin:8px 0 0;opacity:.92}
.hero .watermark{position:absolute;right:24px;top:50%;transform:translateY(-50%);font-size:200px;line-height:1;color:rgba(255,255,255,.08);pointer-events:none}

main{max-width:1280px;margin:auto;padding:20px 24px}
.top,.bottom{display:grid;gap:16px;grid-template-columns:1.2fr 1fr 1fr;margin-bottom:16px}
.bottom{grid-template-columns:1.6fr 1fr 1fr}
.card,.shortcuts{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:var(--shadow);min-width:0}
.card{margin-bottom:0}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
.card-head h2{display:flex;align-items:center;gap:8px}
.more{color:var(--muted);font-size:13px;white-space:nowrap}
.more:hover{color:var(--purple)}
.row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
#issue{font-weight:700}
#time{font-size:13px}

/* 开奖球 */
.balls{display:flex;align-items:center;justify-content:center;gap:10px;padding:22px 0 14px;font-size:20px;user-select:none}
.ball{position:relative;overflow:hidden;flex:none;width:62px;height:62px;border-radius:50%;background:#eef1f8;color:#1e2a4a;display:grid;place-items:center;font-size:28px;font-weight:800;box-shadow:inset 0 -3px 6px rgba(30,42,74,.08)}
body.dark .ball{background:#2a2f4a;color:#eef0ff}
.ball.sum{background:linear-gradient(135deg,#8b5cf6,#7c3aed);color:#fff}
.ball canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair;border-radius:50%}
.balls>span{font-weight:700;color:var(--muted)}
.tags{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;min-height:32px}
.tag{display:inline-grid;place-items:center;padding:5px 14px;border-radius:999px;font-size:13px;font-weight:600}
.tag-purple{background:#ede9fe;color:#7c3aed}
.tag-blue{background:#dbeafe;color:#2563eb}
.tag-gray{background:#f1f5f9;color:#64748b}
body.dark .tag-gray{background:#2a2f4a;color:#9aa3c0}
.controls{margin-top:16px}
.squeeze{display:flex;align-items:center;gap:6px;font-size:14px;cursor:pointer}
.squeeze input{accent-color:var(--purple)}
.btns{display:flex;gap:8px;flex-wrap:wrap}
.btn-primary{background:linear-gradient(110deg,#8b5cf6,#7c3aed);color:#fff;border-color:transparent;font-weight:600}
.btn-primary:hover{border-color:transparent;filter:brightness(1.08)}

/* 倒计时 */
.next-issue{font-weight:600;margin:0 0 14px}
.countdown{display:flex;align-items:flex-start;justify-content:center;gap:8px}
.cd-box{display:flex;flex-direction:column;align-items:center;gap:6px}
.cd-box b{background:var(--soft-purple);color:var(--purple);font-size:32px;font-weight:800;font-variant-numeric:tabular-nums;border-radius:12px;padding:8px 14px;min-width:70px;text-align:center}
.cd-box span{font-size:13px;color:var(--muted)}
.countdown>i{font-style:normal;font-size:28px;font-weight:800;color:var(--purple);padding-top:10px}
.progress{height:8px;background:#e9e4fb;border-radius:999px;margin:18px 0 12px;overflow:hidden}
body.dark .progress{background:#2a2f4a}
.progress>div{height:100%;background:linear-gradient(90deg,var(--blue),var(--purple));border-radius:999px;width:0;transition:width 1s linear}

/* 公告 */
.notice-list{list-style:none;margin:0 0 10px;padding:0}
.notice-list li{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}
.notice-list li:last-child{border-bottom:0}
.notice-text{flex:1;min-width:0}

/* 快捷入口 */
.shortcuts{display:flex;justify-content:space-between;gap:8px;margin-bottom:16px;padding:18px 20px}
.shortcuts a{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--ink);flex:1;min-width:0}
.shortcuts a:hover{color:var(--purple)}
.sc-ic{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;font-size:20px}
.c1{background:#dbeafe;color:#2563eb}.c2{background:#ede9fe;color:#7c3aed}.c3{background:#dcfce7;color:#16a34a}.c4{background:#ffedd5;color:#ea580c}.c5{background:#fce7f3;color:#db2777}.c6{background:#cffafe;color:#0891b2}.c7{background:#fef9c3;color:#ca8a04}.c8{background:#e0e7ff;color:#4f46e5}

/* 历史表 */
.filters{margin-bottom:12px}
.filters input{flex:1;min-width:120px}
.scroll{overflow:auto}
table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:13px}
td,th{padding:11px 7px;text-align:center;border-bottom:1px solid var(--line)}
th{color:var(--muted);font-weight:600;background:#f8f9fe}
body.dark th{background:#262b44}
td:first-child{font-weight:600}
.pill{display:inline-grid;place-items:center;min-width:34px;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:700}
.pill-purple{background:#ede9fe;color:#7c3aed}
.pill-blue{background:#dbeafe;color:#2563eb}
#more{width:100%;margin-top:12px}

/* 和值分布 */
.bars{height:210px;display:flex;align-items:end;gap:14px}
.barwrap{flex:1;text-align:center;font-size:12px;min-width:0;display:flex;flex-direction:column;justify-content:flex-end;height:100%}
.barwrap b{color:var(--purple);font-size:14px}
.bar{background:linear-gradient(#a875f5,#5578ed);border-radius:8px 8px 0 0;margin:5px 0 8px}
.barwrap span{color:var(--muted)}

/* 统计 */
.summary{display:grid;gap:12px}
.stat-row{display:grid;grid-template-columns:44px 1fr 1fr;gap:10px;align-items:center}
.stat-label{font-weight:700;color:var(--ink)}
.stat{background:var(--soft-purple);border-radius:12px;text-align:center;padding:12px 6px}
.stat:nth-child(3){background:var(--soft-blue)}
.stat-name{display:block;font-size:13px;color:var(--muted)}
.stat b{display:block;font-size:22px;color:var(--purple);margin-top:2px}

#rules p{margin:0}
footer{text-align:center;padding:20px;color:var(--muted);font-size:13px}

@media(max-width:1000px){
.top,.bottom{grid-template-columns:1fr 1fr}
.top section:first-child,.bottom section:first-child{grid-column:1/-1}
}
@media(max-width:640px){
.topbar nav{gap:12px;padding:10px 14px}
.nav-links{display:none}
.hero{padding:22px 16px}
.hero-right{display:none}
.hero h1{font-size:28px}
.hero-badge{width:52px;height:52px;font-size:28px}
main{padding:14px}
.top,.bottom{display:block}
.card{margin-bottom:14px}
.shortcuts{display:grid;grid-template-columns:repeat(4,1fr);gap:14px 6px}
.ball{width:52px;height:52px;font-size:24px}
.cd-box b{font-size:26px;min-width:58px}
.row input{max-width:48%}
}
