/* 新版官网的夜间模式：html 上有 data-theme="dark" 时生效（由 /static/site/js/theme.js 设置）。
   只改颜色。横幅、下载区是紫色渐变，本来就是深色，不变；功能演示里的窗口和手机是应用界面的示意，保持浅色，只压暗一点。 */

/* 切换按钮（日间和夜间都用） */
.sr-theme{flex:none;width:32px;height:32px;margin-left:22px;padding:6px;border:0;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;cursor:pointer;line-height:0;transition:background .2s;}
.sr-theme:hover{background:rgba(255,255,255,.3);}
.sr-theme svg{width:20px;height:20px;display:block;}
.sr-theme .sun{display:none;}
.sr-theme+.sr-user{margin-left:14px;}
html[data-theme="dark"] .sr-theme .sun{display:block;}
html[data-theme="dark"] .sr-theme .moon{display:none;}
@media (max-width:991px){.sr-theme{margin-left:10px;}.sr-theme+.sr-user{margin-left:10px;}}

html[data-theme="dark"]{
  color-scheme:dark;
  --sr-accent:#a88dff;
  --sr-ink:#f1eff8;
  --sr-text:#b7b4c6;
  --sr-muted:#8b889c;
  --sr-soft:#18171f;
  --sr-line:#322f40;
  --sr-shadow:0 18px 50px rgba(0,0,0,.5);
  --sr-bg:#121117;
  --sr-card:#1e1d27;
  --sr-tint:#272142;
}
/* 白底上的紫色文字、演示里的应用界面：仍按浅色算 */
html[data-theme="dark"] .sr-login,
html[data-theme="dark"] .sr-platforms,
html[data-theme="dark"] .sr-hero,
html[data-theme="dark"] .sr-cta,
html[data-theme="dark"] [data-demo]{
  --sr-accent:#6236ff;--sr-ink:#222;--sr-text:#555;--sr-muted:#8a8a9a;--sr-soft:#f9faff;--sr-line:#ebe9f5;--sr-shadow:0 18px 50px rgba(0,0,0,.4);
}
html[data-theme="dark"] [data-demo]{filter:brightness(.86);}

html[data-theme="dark"] body.sr{background:var(--sr-bg);}
html[data-theme="dark"] .sr img.sr-dim,html[data-theme="dark"] .sr-rich img{filter:brightness(.88);}
html[data-theme="dark"] .sr-user-menu{background:#262431;border-color:rgba(255,255,255,.1);box-shadow:0 6px 18px rgba(0,0,0,.6);}
html[data-theme="dark"] .sr-user-menu a{color:#dddbe8;}
html[data-theme="dark"] .sr-user-menu a.out{color:#ff6b6b;}
html[data-theme="dark"] .sr-top.fixed{background-image:linear-gradient(90deg,#7a1fa8 0%,#4a2fb0 100%);box-shadow:0 3px 16px rgba(0,0,0,.5);}
html[data-theme="dark"] .sr-hero{background-color:#3d1c7a;}
html[data-theme="dark"] .sr-hero::after{content:"";position:absolute;inset:0;background:rgba(10,8,20,.38);pointer-events:none;}
html[data-theme="dark"] .sr-hero .sr-wrap{position:relative;z-index:1;}

html[data-theme="dark"] .sr-row.alt,html[data-theme="dark"] .sr-demo{background:var(--sr-bg);}
html[data-theme="dark"] .sr-demo.soft{background:var(--sr-soft);}
html[data-theme="dark"] .sr-row p,html[data-theme="dark"] .sr-demo p.desc,html[data-theme="dark"] .sr-title p,html[data-theme="dark"] .sr-card p{color:#a3a0b4;}
html[data-theme="dark"] .sr-tag{background:var(--sr-tint);}
html[data-theme="dark"] .sr-tag.new{color:#fff;}
html[data-theme="dark"] .sr-card{background:var(--sr-card);}
html[data-theme="dark"] .sr-demo ul.points li{color:var(--sr-text);}
html[data-theme="dark"] .sr-plat span{background:var(--sr-card);color:#a3a0b4;}
html[data-theme="dark"] .sr-plat span.on{border-color:#4a3f85;color:var(--sr-accent);background:var(--sr-tint);}
html[data-theme="dark"] .sr-jump{background:rgba(18,17,23,.92);}
html[data-theme="dark"] .sr-jump a{color:var(--sr-text);}
html[data-theme="dark"] .sr-jump a:hover{background:var(--sr-tint);}
html[data-theme="dark"] .sr-jump a.on{color:#fff;}

html[data-theme="dark"] .sr-compare .box{background:var(--sr-card);box-shadow:none;color:#c6c3d4;}
html[data-theme="dark"] .sr-compare .box tr:first-child td,html[data-theme="dark"] .sr-compare .box tr:first-child th{background:var(--sr-tint);}
html[data-theme="dark"] .sr-compare .box tr:not(:first-child):hover td{background:#23212d;}
html[data-theme="dark"] .sr-compare .box td:first-child{color:#e3e1ee;}

html[data-theme="dark"] .sr-cta{background:#3d1c7a linear-gradient(90deg,#7a1fa8 0%,#4a2fb0 100%);}
html[data-theme="dark"] .sr-client{background:var(--sr-card);}
html[data-theme="dark"] .sr-client .os{background:var(--sr-tint);}
html[data-theme="dark"] .sr-client p{color:#9b98ab;}
html[data-theme="dark"] .sr-client .act{background:transparent;border-color:#4a3f85;}
html[data-theme="dark"] .sr-client .act:hover{background:var(--sr-tint);}
html[data-theme="dark"] .sr-client .act.main{color:#fff;}
html[data-theme="dark"] .sr-client .act.off{color:#77748a;border-color:#3a3846;background:#1a1921;}
html[data-theme="dark"] .sr-qr .pop{background:#262431;color:#c6c3d4;box-shadow:0 10px 30px rgba(0,0,0,.6);}
html[data-theme="dark"] .sr-foot{background:#0b0a0f;}

@media (max-width:991px){
  html[data-theme="dark"] .sr-top{background-image:linear-gradient(90deg,rgba(122,31,168,.94) 0%,rgba(74,47,176,.94) 100%);}
  html[data-theme="dark"] .sr-nav{background:#1e1d27;box-shadow:0 14px 30px rgba(0,0,0,.6);}
  html[data-theme="dark"] .sr-nav .nav-item{border-bottom-color:#2c2a38;}
  html[data-theme="dark"] .sr-nav .nav-link{color:#dddbe8;}
  html[data-theme="dark"] .sr-nav .nav-item.active .nav-link{color:var(--sr-accent);}
}

/* ---------- 文章、列表、评论（article.css） ---------- */
html[data-theme="dark"] .sr-tabs a{color:var(--sr-text);background:var(--sr-card);}
html[data-theme="dark"] .sr-tabs a:hover{color:var(--sr-accent);}
html[data-theme="dark"] .sr-tabs a.on{color:#fff;}
html[data-theme="dark"] .sr-post,html[data-theme="dark"] .sr-article,html[data-theme="dark"] .sr-cmts{background:var(--sr-card);box-shadow:none;}
html[data-theme="dark"] .sr-post:hover{box-shadow:var(--sr-shadow);}
html[data-theme="dark"] .sr-post .intro,html[data-theme="dark"] .sr-relnotes{color:var(--sr-text);}
html[data-theme="dark"] .sr-404-num{color:#a88dff;}
html[data-theme="dark"] .sr-article.sr-404 .sr-404-tip{color:#a3a0b4;}
html[data-theme="dark"] .sr-404-btns .sr-btn:not(.solid){background:transparent;color:#c6c3d4!important;}
html[data-theme="dark"] .sr-404-btns .sr-btn:not(.solid):hover{background:transparent;color:var(--sr-accent)!important;}
html[data-theme="dark"] .sr-pagebar .page{background:var(--sr-card);color:var(--sr-text);}
html[data-theme="dark"] .sr-pagebar .now-page{color:#fff;}
html[data-theme="dark"] .sr-rich{color:#c6c3d4;}
html[data-theme="dark"] .sr .sr-rich blockquote{background:var(--sr-tint);color:var(--sr-text);}
html[data-theme="dark"] .sr .sr-rich pre{background:#16151c;}
html[data-theme="dark"] .sr .sr-rich tr:first-child td,html[data-theme="dark"] .sr .sr-rich th{background:var(--sr-tint);}
/* 后台编辑器里写死的字色和底色（多半是从别处粘贴带来的黑字白底），夜间一律跟随页面 */
html[data-theme="dark"] .sr .sr-rich [style*="color"]:not(a){color:inherit!important;}
html[data-theme="dark"] .sr .sr-rich [style*="background"]{background-color:transparent!important;}
html[data-theme="dark"] .sr-cmt .avatar{background:var(--sr-tint);}
html[data-theme="dark"] .sr-cmt .text{color:#c6c3d4;}
html[data-theme="dark"] .sr-cmt .sr-cmt .sr-cmt{background:var(--sr-card);}
html[data-theme="dark"] .sr-cmt-form.reply-frm{background:var(--sr-card);}
html[data-theme="dark"] .sr-cmt-form label em{color:#ff7b7f;}
html[data-theme="dark"] .sr-cmt-form input[type=text],html[data-theme="dark"] .sr-cmt-form textarea{background:#16151c;color:#e8e6f0;}
html[data-theme="dark"] .cmt-tip.ok{color:#4fd08a;}
html[data-theme="dark"] .cmt-tip.err{color:#ff7b7f;}
