#discover { order:4; width:100%; max-width:1240px; min-width:0; box-sizing:border-box; margin:0 auto 24px; padding:0 20px; }
.discover-panel { min-width:0; padding:20px; margin-bottom:18px; border:1px solid rgba(101,212,190,.18); border-radius:18px; background:rgba(12,25,28,.78); color:#f5f7f7; backdrop-filter:blur(20px); box-shadow:0 16px 40px #0002; }
.discover-header { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.discover-header>div { flex:1; min-width:150px; }
.discover-header h2 { margin:0; font-size:1.1rem; }
.discover-header p,.discover-status { font-size:.78rem; opacity:.75; margin:6px 0 0; }
.discover-header mdui-button-icon { color:#fff; }
.discover-track { display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x mandatory; overscroll-behavior-x:contain; padding:3px 2px 14px; scrollbar-width:thin; scrollbar-color:#ffffff50 transparent; }
.discover-card { position:relative; display:flex; flex-direction:column; flex:0 0 272px; min-width:0; scroll-snap-align:start; background:#26383c; color:#f5f7f7; border:1px solid #ffffff14; border-radius:16px; overflow:hidden; text-decoration:none; box-shadow:0 3px 9px #0004; transition:transform .2s,box-shadow .2s,background-color .2s; }
.discover-card:visited { color:#f5f7f7; }
.discover-card:hover { transform:translateY(-2px); background:#30484c; box-shadow:0 6px 15px #0005; }
.discover-card:focus-visible { outline:3px solid #b9c5ff; outline-offset:2px; }
.discover-media { width:100%; aspect-ratio:16/9; overflow:hidden; background:#203338; }
.discover-media img { display:block; width:100%; height:100%; object-fit:cover; }
.discover-repo-card .discover-media img { object-fit:contain; background:#eaf0f0; }
.discover-cover { display:grid; place-items:center; height:100%; background:linear-gradient(135deg,#30575c,#27364b); font-size:38px; color:#b0ddd5; }
.discover-card-body { display:flex; flex-direction:column; flex:1; padding:16px; }
.discover-card h3 { margin:0 0 10px; font-size:1rem; line-height:1.5; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.discover-card p { font-size:.84rem; line-height:1.6; opacity:.8; margin:0 0 14px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.discover-card small { display:block; margin-top:auto; padding-top:2px; font-size:.75rem; opacity:.75; }
.metadata-hint { display:block; max-width:100%; font-size:.8rem; line-height:1.5; margin:0; overflow-wrap:anywhere; }
.metadata-hint:empty { display:none; }
.metadata-hint img { vertical-align:middle; margin-right:8px; width:24px; height:24px; object-fit:contain; }
@media(max-width:600px){ #discover { padding:0 12px; } .discover-panel { padding:16px; } .discover-card { flex-basis:min(272px,78vw); } }
@media(prefers-reduced-motion:reduce){.discover-card{transition:none;}}

.discover-track::-webkit-scrollbar { height:5px; }
.discover-track::-webkit-scrollbar-track { background:transparent; }
.discover-track::-webkit-scrollbar-thumb { background:#ffffff50; border-radius:999px; }
.discover-track::-webkit-scrollbar-button { display:none; }

@media(max-width:600px){.discover-header>div{min-width:0;}.discover-header h2{font-size:1rem;}}
.discover-card:active { background:#3c565b; transform:scale(.985); }
.discover-more { flex:0 0 108px; scroll-snap-align:end; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; color:#e4e8ff; text-decoration:none; font-size:.9rem; border-radius:16px; }
.discover-more:visited { color:#e4e8ff; }
.discover-more-circle { display:grid; place-items:center; width:64px; height:64px; border-radius:50%; color:#243353; background:#dce1ff; box-shadow:0 3px 8px #0005; transition:background .2s,box-shadow .2s,transform .2s; }
.discover-more:hover .discover-more-circle { background:#eef0ff; box-shadow:0 6px 14px #0006; transform:translateX(3px); }
.discover-more:active .discover-more-circle { background:#bdc8f1; transform:scale(.95); }
.discover-more:focus-visible { outline:3px solid #b9c5ff; outline-offset:-3px; }
.discover-header>.discover-platform { position:relative; display:inline-flex; flex:0 0 auto; min-width:0; padding:3px; border:1px solid #a7b6bd; border-radius:999px; background:#162a2e; isolation:isolate; }
.discover-platform-thumb { position:absolute; z-index:-1; top:3px; bottom:3px; left:3px; width:calc((100% - 6px)/2); border-radius:999px; background:#dce1ff; box-shadow:0 1px 4px #0004; transition:transform .24s cubic-bezier(.2,0,0,1); }
.discover-platform[data-value="youtube"] .discover-platform-thumb { transform:translateX(100%); }
.discover-platform button { display:flex; align-items:center; justify-content:center; gap:5px; width:108px; min-height:38px; padding:6px 10px; border:0; border-radius:999px; background:transparent; color:#e4ebed; font:inherit; font-size:.85rem; cursor:pointer; transition:color .2s,background-color .2s; }
.discover-platform button[aria-checked="true"] { color:#233451; }
.discover-platform button .material-icons { width:16px; font-size:16px; opacity:0; transition:opacity .2s; }
.discover-platform button[aria-checked="true"] .material-icons { opacity:1; }
.discover-platform button:hover { background:#ffffff14; }
.discover-platform button:focus-visible { outline:2px solid #aebeff; outline-offset:3px; }
@media(max-width:600px){.discover-header>div:first-child{flex:1 0 calc(100% - 60px);}.discover-header>.discover-platform{order:2;}.discover-more{flex-basis:90px;}.discover-more-circle{width:60px;height:60px;}}
@media(prefers-reduced-motion:reduce){.discover-platform-thumb,.discover-platform button,.discover-more-circle{transition:none;}}

/* Native in-feed creative; keep Google's content untouched and visibly identified. */
.discover-video-ad { align-self:stretch; box-sizing:border-box; height:auto; min-height:0; min-width:268px; padding:8px; cursor:default; transition:none; background:#26383c; border:1px solid #ffffff14; border-radius:16px; box-shadow:0 3px 9px #0004; overflow:visible; }
.discover-video-ad:hover,.discover-video-ad:active { transform:none; background:#26383c; box-shadow:0 3px 9px #0004; }
.discover-video-ad[hidden] { display:none; }
.discover-video-ad .adsbygoogle { display:block; width:100%; min-width:250px; max-width:100%; }
@media(max-width:600px){.discover-video-ad{flex-basis:max(268px,min(272px,78vw));}}

.discover-platform button { width:56px; min-height:40px; padding:8px; }
.platform-icon { display:block; width:24px; height:24px; background:currentColor; mask:var(--platform-icon) center/contain no-repeat; -webkit-mask:var(--platform-icon) center/contain no-repeat; }
.platform-icon-bilibili { --platform-icon:url('/img/platforms/bilibili.svg'); }
.platform-icon-youtube { --platform-icon:url('/img/platforms/youtube.svg'); }
.discover-next { --mdui-color-secondary-container:58,76,82; --mdui-color-on-secondary-container:238,242,245; }
@media(max-width:600px){.discover-header .discover-next{order:2;}.discover-header>.discover-platform{order:2;}}

button.discover-more { border:0; padding:12px 4px; background:transparent; font:inherit; font-size:.9rem; cursor:pointer; }
button.discover-more:disabled { cursor:progress; opacity:.6; }
button.discover-more:disabled .discover-more-circle { transform:none; }

.discover-card small.discover-video-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; }
.discover-meta-item { display:inline-flex; align-items:center; gap:5px; min-width:0; max-width:100%; }
.discover-meta-item .material-icons { flex:none; font-size:16px; line-height:1; }
.discover-meta-item>span:last-child { min-width:0; overflow-wrap:anywhere; }

.discover-refresh-control { display:inline-grid; place-items:center; width:40px; height:40px; flex:0 0 40px; }
.discover-refresh-control>mdui-button-icon,.discover-refresh-progress { grid-area:1/1; }
.discover-refresh-control.is-loading>mdui-button-icon { opacity:0; pointer-events:none; }
.discover-refresh-progress { width:22px; height:22px; --mdui-color-primary:220,225,255; }
.discover-refresh-progress[hidden] { display:none; }

.discover-card small.discover-ad-meta { margin-top:auto; padding:20px 8px 8px; min-height:18px; opacity:1; }
.discover-ad-meta>.discover-meta-item { opacity:.8; }

.discover-ad-close { margin-left:auto; flex:0 0 44px; width:44px; height:44px; color:inherit; opacity:.8; background:transparent; border:0; box-shadow:none; --mdui-color-on-surface:245,247,247; }
.discover-ad-close::part(button) { color:inherit; }
.discover-ad-close:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.discover-ad-close[hidden] { display:none; }
/* Music shares the article cards but uses square album covers. */
#music-platform { max-width:100%; --mdui-color-primary:208,188,255; --mdui-color-on-surface:245,247,247; --mdui-color-secondary-container:62,74,100; --mdui-color-on-secondary-container:240,235,255; }
.music-card { flex-basis:210px; }
.music-cover { position:relative; aspect-ratio:1; }
.music-rank { position:absolute; left:10px; top:10px; border-radius:10px; padding:4px 8px; background:#14272dcc; color:#fff; font-size:.8rem; font-variant-numeric:tabular-nums; }
/* Ad creatives remain in the same light color scheme in both site themes;
   this avoids browser-forced darkening of only parts of the cross-origin ad. */
.discover-video-ad .adsbygoogle,.discover-video-ad .adsbygoogle iframe { color-scheme:light only; border:0!important; background-color:transparent!important; }

.music-platform-icon { display:block; width:24px; height:24px; background:currentColor; mask:var(--music-logo) center/contain no-repeat; -webkit-mask:var(--music-logo) center/contain no-repeat; }
.music-platform-apple { --music-logo:url('/img/platforms/applemusic.svg'); }
.music-platform-qq { --music-logo:url('/img/platforms/qqmusic.svg'); }
.music-chart { max-width:100%; min-height:40px; padding:8px 32px 8px 12px; border:1px solid #a7b6bd; border-radius:12px; background:#26383c; color:#f5f7f7; font:inherit; font-size:.85rem; color-scheme:dark; }
.discover-header [hidden] { display:none!important; }
/* Stable translucent paint without a large backdrop-filter layer. */
.discover-panel { background:rgba(12,25,28,.91); }
@media(max-width:600px){#music-platform{flex:none}#music-platform mdui-segmented-button{min-width:52px}.music-chart{flex:1;min-width:120px}.music-card{flex-basis:min(210px,68vw)}}
