/* 全站布局：毛玻璃顶栏 / 底栏 / 页脚，与 home 玻璃页一致 */

:root {
    --shell-accent: #7dd3fc;
    --shell-text: rgba(248, 250, 252, 0.96);
    --shell-muted: rgba(203, 213, 225, 0.75);
    --shell-glass: rgba(255, 255, 255, 0.07);
    --shell-border: rgba(255, 255, 255, 0.18);
    --shell-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

body.app-shell {
    font-family: "Outfit", system-ui, -apple-system, sans-serif;
    color: var(--shell-text);
    background: linear-gradient(165deg, #0c1222 0%, #1a1033 38%, #0f172a 72%, #042f2e 100%);
    background-attachment: fixed;
    padding-top: 4.35rem !important;
    padding-bottom: 3.25rem !important;
    min-height: 100vh;
}

body.app-shell.app-shell--with-bottom-bar {
    padding-bottom: 6.5rem !important;
}

header .navbar.app-shell-nav {
    background: rgba(12, 18, 34, 0.55) !important;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--shell-border);
    box-shadow: var(--shell-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

header .navbar.app-shell-nav .navbar-brand {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--shell-text) !important;
    background: linear-gradient(120deg, #f8fafc, #a5f3fc 55%, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .navbar.app-shell-nav .navbar-brand:hover {
    opacity: 0.92;
}

header .navbar.app-shell-nav .nav-link {
    color: rgba(226, 232, 240, 0.88) !important;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 8px;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    margin-left: 0.1rem;
    margin-right: 0.1rem;
    transition: color 0.15s ease, background 0.15s ease;
}

header .navbar.app-shell-nav .nav-link:hover,
header .navbar.app-shell-nav .nav-link:focus {
    color: var(--shell-accent) !important;
    background: rgba(125, 211, 252, 0.08);
}

header .navbar.app-shell-nav .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.25);
}

header .navbar.app-shell-nav .navbar-toggler-icon {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

header .navbar.app-shell-nav .form-control {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--shell-border);
    color: var(--shell-text);
    border-radius: 10px;
    font-size: 0.875rem;
    min-width: 8rem;
}

header .navbar.app-shell-nav .form-control::placeholder {
    color: var(--shell-muted);
}

header .navbar.app-shell-nav .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(125, 211, 252, 0.45);
    color: var(--shell-text);
    box-shadow: 0 0 0 0.15rem rgba(125, 211, 252, 0.2);
}

header .navbar.app-shell-nav .btn-outline-light {
    color: var(--shell-accent) !important;
    border-color: rgba(125, 211, 252, 0.4) !important;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.4rem 0.85rem;
}

header .navbar.app-shell-nav .btn-outline-light:hover {
    background: rgba(125, 211, 252, 0.15) !important;
    border-color: var(--shell-accent) !important;
    color: #e0f2fe !important;
}

header .navbar.app-shell-nav .dropdown-menu {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--shell-border);
    border-radius: 12px;
    box-shadow: var(--shell-shadow);
    padding: 0.4rem;
    margin-top: 0.35rem;
}

header .navbar.app-shell-nav .dropdown-item {
    color: rgba(226, 232, 240, 0.92);
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
}

header .navbar.app-shell-nav .dropdown-item:hover,
header .navbar.app-shell-nav .dropdown-item:focus {
    background: rgba(125, 211, 252, 0.12);
    color: var(--shell-accent);
}

main[role="main"] {
    position: relative;
    z-index: 0;
}

/*
 * glass-page 内的 .glass-page__bg 等为 position:fixed 且铺满视口，仍属于 main 的子树堆叠。
 * 若页脚在 </main> 之后且无更高 z-index，会被该背景层盖住（看起来像「页脚消失」）。
 */
body.app-shell > footer.app-shell-site-footer {
    position: relative;
    z-index: 2;
}

.app-shell-footer {
    margin-top: 2rem !important;
    color: var(--shell-muted) !important;
    font-size: 0.9rem;
}

.app-shell-footer a {
    color: var(--shell-accent) !important;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.app-shell-footer a:hover {
    color: #e0f2fe !important;
    border-bottom-color: rgba(125, 211, 252, 0.5);
}

.app-shell-report {
    margin-bottom: 1rem !important;
}

.app-shell-report .report-link {
    color: var(--shell-muted) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    transition: color 0.15s ease;
}

.app-shell-report .report-link:hover {
    color: var(--shell-accent) !important;
}

.app-shell-report .report-link-text {
    color: inherit;
}

/* Box 页固定底栏 */
nav.navbar.app-shell-nav--bottom {
    background: rgba(12, 18, 34, 0.65) !important;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--shell-border) !important;
    border-bottom: none !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

nav.navbar.app-shell-nav--bottom .nav-link {
    color: rgba(226, 232, 240, 0.9) !important;
    font-size: 0.85rem;
}

nav.navbar.app-shell-nav--bottom .nav-link:hover {
    color: var(--shell-accent) !important;
}

nav.navbar.app-shell-nav--bottom .nav-item.nav-link {
    color: var(--shell-muted) !important;
    font-size: 0.8rem !important;
}

nav.navbar.app-shell-nav--bottom .queue_list_now,
nav.navbar.app-shell-nav--bottom .queue_list_finished {
    color: var(--shell-accent);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-weight: 500;
}

/* layer 弹层（首页 trendShow「阅读」）：与毛玻璃壳一致 */
body .layui-layer.layui-layer-glass {
    background: rgba(15, 23, 42, 0.82) !important;
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid var(--shell-border) !important;
    border-radius: 18px !important;
    box-shadow: var(--shell-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

body .layui-layer.layui-layer-glass .layui-layer-title {
    height: auto !important;
    line-height: 1.35 !important;
    padding: 0.85rem 3rem 0.85rem 1.1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--shell-text) !important;
    font-weight: 600;
    font-size: 1rem;
}

body .layui-layer.layui-layer-glass .layui-layer-content {
    color: var(--shell-muted);
    background: transparent !important;
}

body .layui-layer.layui-layer-glass .layui-layer-setwin {
    top: 14px !important;
    right: 12px !important;
}

/*
 * 关闭：不用 layer 默认雪碧图 + invert（在深色玻璃/复杂背景上几乎看不见），
 * 改为圆底 + 「×」，保证对比度与点击区域。
 */
body .layui-layer.layui-layer-glass .layui-layer-setwin a {
    filter: none !important;
    opacity: 1 !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    min-width: 2.25rem !important;
    min-height: 2.25rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: rgba(15, 23, 42, 0.88) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.32) !important;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-indent: 0 !important;
    overflow: hidden !important;
    line-height: 1 !important;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body .layui-layer.layui-layer-glass .layui-layer-setwin a::after {
    content: '\00d7';
    font-size: 1.45rem;
    font-weight: 300;
    line-height: 1;
    color: rgba(248, 250, 252, 0.96);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    margin-top: -0.08em;
}

body .layui-layer.layui-layer-glass .layui-layer-setwin a:hover {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(125, 211, 252, 0.55) !important;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(125, 211, 252, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body .layui-layer.layui-layer-glass .layui-layer-setwin a:hover::after {
    color: #f0f9ff;
}

.glass-trend-layer {
    padding: 0.15rem 0.25rem 0.5rem;
    font-family: "Outfit", system-ui, -apple-system, sans-serif;
    text-align: left;
}

.glass-trend-layer__backbone {
    font-weight: 600;
    color: var(--shell-text);
    margin: 0 0 0.85rem;
    line-height: 1.45;
}

.glass-trend-layer__content {
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.92);
}

.glass-trend-layer__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.glass-trend-layer__meta {
    margin-top: 1.15rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    color: var(--shell-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    align-items: baseline;
}

.glass-trend-layer__time {
    opacity: 0.9;
}

/* 文章/评论内图片点击放大（trend.js layer） */
body .layui-layer.layui-layer-glass.trend-layer-img-preview {
    border-radius: 16px !important;
    /* 不设 overflow:hidden，否则右上角关闭键会被圆角裁掉；改由 content 区裁剪图片 */
    overflow: visible;
}

/* 关闭按钮与圆角留出间距（layui 默认贴角易被 16px 圆角盖住） */
body .layui-layer.layui-layer-glass.trend-layer-img-preview .layui-layer-setwin {
    top: 18px !important;
    right: 18px !important;
    z-index: 2;
}

body .layui-layer.layui-layer-glass.trend-layer-img-preview .layui-layer-setwin a {
    margin: 2px;
    box-sizing: border-box !important;
}

body .layui-layer.layui-layer-glass.trend-layer-img-preview .layui-layer-content {
    height: 100% !important;
    overflow: hidden !important;
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 16px;
}

body .layui-layer.layui-layer-glass.trend-layer-img-preview .trend-img-preview-inner {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

body .layui-layer.layui-layer-glass.trend-layer-img-preview .trend-img-preview-img {
    max-width: 100%;
    max-height: min(85vh, 820px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-out;
}
