/* tilitili glass dashboard — visual layer inspired by the supplied reference */

:root {
    --glass-bg: rgba(14, 17, 20, .72);
    --glass-bg-strong: rgba(16, 20, 23, .88);
    --glass-bg-soft: rgba(255, 255, 255, .035);
    --glass-border: rgba(239, 246, 243, .13);
    --glass-border-strong: rgba(239, 246, 243, .24);
    --glass-shadow: 0 24px 70px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .065);
    --glass-green: #fb7299;
    --glass-green-dim: rgba(251, 114, 153, .15);
    --glass-lime: #ffd7e3;
    --glass-violet: #ff9fbb;
    --glass-muted: #7f8985;
    --glass-dim: #59615e;
    --shell-gap: clamp(14px, 1.6vw, 24px);
    /* Keep the legacy interface tokens on the same Bilibili-pink palette. */
    --accent: #fb7299;
    --accent-hover: #ff9fbb;
    --accent-active: #e65380;
    --accent-dim: rgba(251, 114, 153, .15);
    --accent-glow: rgba(251, 114, 153, .28);
    --cyan: #ff9fbb;
    --border-accent: rgba(251, 114, 153, .42);
}

[data-theme="light"] {
    --surface-base: #fffafb;
    --surface-raised: #ffffff;
    --surface-elevated: #ffffff;
    --surface-hover: #fff1f5;
    --accent: #fb7299;
    --accent-hover: #e65380;
    --accent-active: #cf416b;
    --accent-dim: rgba(251, 114, 153, .12);
    --accent-glow: rgba(251, 114, 153, .2);
    --cyan: #ff9fbb;
    --glass-bg: rgba(255, 255, 255, .88);
    --glass-bg-strong: rgba(255, 255, 255, .96);
    --glass-border: rgba(171, 73, 105, .15);
    --glass-border-strong: rgba(171, 73, 105, .24);
    --glass-muted: #735e66;
    --glass-dim: #a18690;
}

html,
body {
    min-height: 100%;
    background: #030505;
}

body {
    overflow: hidden;
    background:
        radial-gradient(720px 520px at 66% 42%, rgba(180, 62, 105, .11), transparent 72%),
        radial-gradient(620px 420px at 12% 92%, rgba(184, 77, 112, .09), transparent 70%),
        #030505;
}

[data-theme="light"] body {
    background:
        radial-gradient(700px 450px at 72% 0%, rgba(251, 114, 153, .11), transparent 70%),
        linear-gradient(180deg, #fff 0%, #fff8fb 100%);
}

#scrollProgress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 300;
    height: 2px;
    background: linear-gradient(90deg, var(--glass-green), var(--glass-violet));
    box-shadow: 0 0 16px rgba(251, 114, 153, .55);
}

#app.glass-shell {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 218px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--shell-gap);
    width: min(1760px, 100%);
    height: 100vh;
    min-height: 620px;
    margin: 0 auto;
    padding: clamp(14px, 2.2vw, 28px);
}

#app.glass-shell::before,
#app.glass-shell::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(80px);
}

#app.glass-shell::before {
    width: 360px;
    height: 260px;
    top: 8%;
    left: 27%;
    background: rgba(180, 62, 105, .08);
}

#app.glass-shell::after {
    width: 280px;
    height: 240px;
    right: 8%;
    bottom: 5%;
    background: rgba(184, 77, 112, .08);
}

.glass-panel {
    background:
        radial-gradient(ellipse at 94% 0%, rgba(255, 255, 255, .075), transparent 28%),
        linear-gradient(138deg, rgba(255, 255, 255, .055), transparent 34%),
        linear-gradient(180deg, rgba(20, 24, 25, .86), rgba(7, 10, 11, .94));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(22px) saturate(125%);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
}

[data-theme="light"] .glass-panel {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 246, 249, .92)),
        rgba(255, 255, 255, .96);
    border-color: rgba(171, 73, 105, .15);
    box-shadow: 0 24px 70px rgba(171, 73, 105, .1), inset 0 1px 0 rgba(255, 255, 255, .98);
}

/* Left navigation rail */
.side-rail {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 24px 14px 14px;
    border-radius: 24px;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 24px;
    color: var(--text-primary);
}

.side-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(251, 114, 153, .48);
    border-radius: 12px;
    background: rgba(251, 114, 153, .09);
    box-shadow: 0 10px 24px rgba(216, 71, 118, .2), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.side-mark svg { display: block; width: 25px; height: 25px; }
.side-mark svg line { stroke: #fb7299; stroke-width: 6; stroke-linecap: round; }
.side-mark svg rect { fill: #fb7299; }
.side-mark svg polygon { fill: #fff; }

.logo svg { filter: drop-shadow(0 8px 18px rgba(251, 114, 153, .3)); }
.logo svg path, .logo svg line { stroke: #fb7299; }
.logo svg rect { fill: #fb7299; }
.logo svg polygon { fill: #fff; }

.side-brand-copy { min-width: 0; }
.side-brand-name { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.045em; }
.side-brand-sub { display: block; margin-top: 2px; color: var(--glass-dim); font-size: 8px; font-weight: 700; letter-spacing: .16em; }

.side-label {
    margin: 0 12px 9px;
    color: var(--glass-dim);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.side-nav { display: grid; gap: 4px; }

.side-nav-item {
    position: relative;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 15px;
    color: var(--glass-muted);
    font-size: 12px;
    font-weight: 650;
    transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease;
}

.side-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .045);
    transform: translateX(2px);
}

.side-nav-item.active {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, .11);
    background:
        radial-gradient(circle at 15% 50%, rgba(255, 255, 255, .18), transparent 38%),
        linear-gradient(96deg, rgba(116, 124, 121, .24), rgba(255, 255, 255, .03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 24px rgba(0, 0, 0, .2);
}

.side-nav-item.active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    border-radius: 2px;
    background: var(--glass-green);
    box-shadow: 0 0 12px var(--glass-green);
}

.side-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    color: var(--glass-muted);
    background: rgba(255, 255, 255, .035);
}

.side-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side-nav-item.active .side-icon { color: var(--glass-green); background: var(--glass-green-dim); }
.side-arrow { color: var(--glass-dim); font-size: 14px; opacity: 0; transition: opacity .22s ease; }
.side-nav-item.active .side-arrow { opacity: 1; }

/* Top bar and center stage */
.main-stage {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

#header {
    position: relative;
    flex: 0 0 76px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 18px;
    padding: 0 20px;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background:
        radial-gradient(ellipse at 72% -50%, rgba(255, 255, 255, .07), transparent 44%),
        rgba(12, 15, 17, .7);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(22px) saturate(125%);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
}

[data-theme="light"] #header { background: rgba(255, 255, 255, .92); border-color: rgba(171, 73, 105, .15); }
#header::before, #header::after { display: none; }
.header-left { display: none; }
.header-center { flex: 1; min-width: 0; max-width: none; display: flex; justify-content: center; }
#navTabs { display: none; }

.search-box {
    width: min(100%, 620px);
    height: 43px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

[data-theme="light"] .search-box { background: rgba(255, 255, 255, .86); border-color: rgba(171, 73, 105, .16); }
.search-box:focus-within { border-color: rgba(251, 114, 153, .42); box-shadow: 0 0 0 4px rgba(251, 114, 153, .08), inset 0 1px 0 rgba(255, 255, 255, .06); }
.search-leading { width: 17px; height: 17px; margin-left: 16px; color: var(--glass-muted); }
.search-box input { min-width: 0; padding: 0 12px; color: var(--text-primary); font-size: 12px; }
.search-box input::placeholder { color: var(--glass-dim); }
.search-box button { min-width: 78px; height: 35px; margin: 3px; padding: 0 14px; border-radius: 999px; background: linear-gradient(135deg, #ffabc2, #d84776); color: #270711; box-shadow: 0 8px 22px rgba(216, 71, 118, .22); font-size: 11px; font-weight: 800; }
.search-box button:hover { background: linear-gradient(135deg, #ffc5d6, #ed6d95); }

.header-right { display: flex; align-items: center; gap: 10px; margin-left: 0; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; color: var(--glass-muted); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--glass-green); box-shadow: 0 0 10px var(--glass-green); }
#themeToggle { width: 39px; height: 39px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; background: rgba(255,255,255,.035); color: var(--glass-muted); }
#themeToggle:hover { border-color: var(--glass-border-strong); background: rgba(255,255,255,.07); color: var(--glass-green); }

#main {
    max-width: none;
    width: 100%;
    min-height: 0;
    height: calc(100vh - 116px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 4px 48px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

#main::-webkit-scrollbar { width: 7px; }
#main::-webkit-scrollbar-thumb { border-radius: 9px; background: rgba(255,255,255,.12); }
#content { min-height: 100%; }

/* Content cards: reuse the existing data and interactions with a glass surface */
.hero { border: 1px solid var(--glass-border); border-radius: 22px; background: var(--glass-bg-strong); box-shadow: var(--glass-shadow); }
.hero-slide { min-height: 330px; aspect-ratio: 2.1 / 1; }
.hero-slide::after { background: linear-gradient(90deg, rgba(3, 7, 6, .96), rgba(3, 7, 6, .56) 38%, rgba(3, 7, 6, .06) 76%), linear-gradient(0deg, rgba(3, 7, 6, .78), transparent 56%); }
.hero-info { left: clamp(24px, 4vw, 58px); bottom: clamp(28px, 4vw, 52px); }
.hero-tag { border-color: rgba(251, 114, 153, .26); background: rgba(251, 114, 153, .12); color: var(--glass-lime); }
.hero-title { font-size: clamp(26px, 3vw, 46px); letter-spacing: -.045em; }
.hero-play { color: #260913; background: linear-gradient(135deg, #ffd7e3, #f2769b); box-shadow: 0 12px 28px rgba(216, 71, 118, .18); }
.chips { gap: 8px; margin-bottom: 26px; }
.chip { border-color: var(--glass-border); background: rgba(255,255,255,.035); }
.chip:hover { border-color: rgba(251, 114, 153, .34); background: var(--glass-green-dim); }
.section-header { margin-bottom: 15px; }
.section-title { font-size: 19px; letter-spacing: -.035em; }
.section-title::before { width: 4px; height: 18px; background: linear-gradient(180deg, var(--glass-green), #c84f78); box-shadow: 0 0 13px rgba(251, 114, 153, .4); }
.video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 15px; }
.video-card { padding: 7px; border: 1px solid transparent; border-radius: 17px; background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); transition: transform .3s cubic-bezier(.16,1,.3,1), border-color .3s ease, background .3s ease, box-shadow .3s ease; }
.video-card:hover { border-color: rgba(251, 114, 153, .18); background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.025)); box-shadow: 0 16px 36px rgba(0,0,0,.22); }
.video-card .cover { border-color: rgba(255,255,255,.1); border-radius: 13px; box-shadow: 0 8px 22px rgba(0,0,0,.22); }
.video-card:hover .cover { border-color: rgba(255,255,255,.2); box-shadow: 0 16px 32px rgba(0,0,0,.3); }
.video-card .info { padding: 11px 3px 3px; }
.video-card .title { min-height: 40px; font-size: 13px; }
.video-card .up { font-size: 10px; }
.video-card .cover .duration, .video-card .cover .play-count { border-color: rgba(255,255,255,.15); background: rgba(3,7,6,.62); backdrop-filter: blur(10px); }
.video-card .play-glass { border-color: rgba(255,255,255,.28); background: rgba(5, 12, 10, .45); }
.ranking-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rank-item { border-color: var(--glass-border); border-radius: 16px; background: rgba(255,255,255,.035); }
.rank-item:hover { border-color: rgba(251, 114, 153, .25); background: rgba(255,255,255,.065); }
.rank-item:nth-child(-n+3) .rank-num { color: var(--glass-green); }
.empty-state { min-height: 300px; border: 1px solid var(--glass-border); border-radius: 20px; background: rgba(255,255,255,.025); }
.skeleton-card { border: 1px solid var(--glass-border); border-radius: 17px; background: rgba(255,255,255,.035); }
#backToTop { position: fixed; right: 22px; bottom: 22px; z-index: 210; display: grid; place-items: center; }
#backToTop { color: var(--accent); cursor: pointer; }
#backToTop svg, #backToTop path { fill: currentColor; }
[data-theme="light"] #backToTop { background: rgba(255, 255, 255, .94); border-color: rgba(171, 73, 105, .16); box-shadow: 0 14px 30px rgba(171, 73, 105, .12); }
#backToTop:hover { color: #fff; background: linear-gradient(135deg, #ffabc2, #d84776); border-color: rgba(251, 114, 153, .42); }

[data-theme="light"] .side-nav-item.active { background: linear-gradient(96deg, rgba(251, 114, 153, .14), rgba(255,255,255,.78)); }

@media (max-width: 1250px) {
    #app.glass-shell { grid-template-columns: 200px minmax(0, 1fr); }
    .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
    #app.glass-shell { grid-template-columns: 190px minmax(0, 1fr); }
    .hero-slide { min-height: 310px; }
}

@media (max-width: 820px) {
    body { overflow: auto; }
    #app.glass-shell { display: block; width: 100%; height: auto; min-height: 100vh; padding: 0 0 70px; }
    .side-rail { display: none; }
    .main-stage { display: block; }
    #header { position: sticky; top: 0; z-index: 100; height: 68px; margin: 0; padding: 0 16px; border-width: 0 0 1px; border-radius: 0; background: rgba(7,10,11,.92); backdrop-filter: none; -webkit-backdrop-filter: none; }
    [data-theme="light"] #header { background: rgba(255,255,255,.88); }
    .header-left { display: block; flex: 0 0 auto; }
    .header-left .logo { display: flex; align-items: center; gap: 8px; }
    .header-left .logo svg { width: 29px; height: 29px; }
    .header-left .logo-name { font-size: 15px; }
    .header-left .logo-beta { display: none; }
    .header-center { justify-content: stretch; }
    .search-box { min-width: 0; height: 40px; }
    .search-box button { min-width: 42px; width: 42px; padding: 0; }
    .search-box button span { display: none; }
    .header-right { gap: 6px; }
    .live-pill { display: none; }
    #themeToggle { width: 36px; height: 36px; }
    #navTabs { position: fixed; top: auto !important; right: 0; bottom: 0 !important; left: 0; z-index: 160; display: flex; align-items: center; justify-content: center; gap: 18px; height: 62px; padding: 0 14px; border-top: 1px solid var(--glass-border); background: rgba(7,10,11,.88); backdrop-filter: blur(20px); }
    [data-theme="light"] #navTabs { background: rgba(255,255,255,.9); }
    .nav-tab { padding: 16px 12px; border-radius: 0; font-size: 12px; }
    .nav-tab::after { bottom: 8px; background: linear-gradient(90deg, var(--glass-green), var(--glass-violet)); }
    #main { height: auto; padding: 20px 14px 28px; overflow: visible; }
    #backToTop { right: 16px; bottom: 78px; }
    .hero-slide { min-height: 360px; aspect-ratio: 4 / 5; }
    .hero-info { max-width: none; right: 22px; bottom: 45px; }
    .hero-title { font-size: 27px; }
    .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
    .ranking-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .header-left .logo-name { display: none; }
    .search-leading { margin-left: 12px; }
    .search-box input { padding: 0 8px; font-size: 11px; }
    .hero { border-radius: 18px; }
    .hero-slide { min-height: 350px; }
    .section-title { font-size: 17px; }
    .video-card .title { min-height: 38px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
