/* OpenXiaoBlog 星尘主题：气泡 + 玻璃拟态，参考米哈游系官网风格 */

:root {
    --accent: #6ea8fe;
    --nav-alpha: .75;
    --nav-blur: 12px;
    --hero-overlay: .35;
    --card-rgb: 255, 255, 255;
    --card-alpha: .78;
    --card-bg: rgba(var(--card-rgb), var(--card-alpha));
    --card-border: rgba(255, 255, 255, .65);
    --soft: 0 10px 34px rgba(96, 118, 204, .13);
    --radius: 18px;
    --foot-rgb: 255, 255, 255;
    --foot-alpha: .5;
    --nav-h: 64px;
}

html[data-bs-theme="dark"] {
    --card-rgb: 30, 36, 60;
    --card-border: rgba(120, 140, 220, .16);
    --soft: 0 10px 34px rgba(0, 0, 0, .45);
}

* { scroll-margin-top: 90px; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #f3f6fc 0%, #f6f7fb 45%, #eef3fa 100%);
    background-attachment: fixed;
}

html[data-bs-theme="dark"] body {
    background: linear-gradient(180deg, #0d1220 0%, #111726 55%, #0c111e 100%);
}

::selection { background: rgba(110, 168, 254, .35); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- 顶部线条加载动画 ---------- */
.xb-load {
    position: fixed; top: 0; left: 0; right: 0; height: 2px;
    z-index: 1040; pointer-events: none; opacity: 0; transition: opacity .2s;
}
.xb-load.is-on { opacity: 1; }
.xb-load i {
    display: block; height: 100%; width: 0;
    background: var(--accent); transition: width .16s linear;
}

/* ---------- 导航（气泡 + 透明） ---------- */
.xb-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
    background: rgba(255, 255, 255, var(--nav-alpha));
    -webkit-backdrop-filter: blur(var(--nav-blur));
    backdrop-filter: blur(var(--nav-blur));
    border-bottom: 1px solid rgba(140, 160, 230, .12);
    transition: box-shadow .3s, background .3s;
}
html[data-bs-theme="dark"] .xb-nav { background: rgba(16, 21, 40, var(--nav-alpha)); }
.xb-nav.scrolled { box-shadow: 0 6px 24px rgba(60, 80, 160, .12); }
.xb-nav-inner { display: flex; align-items: center; gap: 14px; height: var(--nav-h); max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.xb-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.18rem; color: inherit; letter-spacing: .5px; }
.xb-logo-img { display: block; object-fit: cover; }
.xb-logo-img.is-square { height: 34px; width: 34px; border-radius: 10px; }
.xb-logo-img.is-rect { height: 32px; width: auto; max-width: 160px; border-radius: 8px; object-fit: contain; }
.xb-nav-links { display: flex; align-items: center; gap: 6px; flex: 1; }
.xb-pill {
    padding: 7px 16px; border-radius: 999px; color: inherit; font-size: .95rem; font-weight: 500;
    transition: all .22s; white-space: nowrap;
}
.xb-pill:hover { background: rgba(110, 168, 254, .14); color: var(--accent); transform: translateY(-1px); }
.xb-pill.active { background: var(--accent); color: #fff !important; animation: xbPillIn .4s cubic-bezier(.22,1,.36,1) both; }
button.xb-pill { background: transparent; border: 0; font: inherit; color: inherit; cursor: pointer; }
@keyframes xbPillIn { from { transform: translateY(4px) scale(.92); opacity: .3; } to { transform: none; opacity: 1; } }
.xb-search {
    display: flex; align-items: center; background: rgba(140, 160, 230, .12);
    border: 1px solid transparent; border-radius: 999px; padding: 4px 6px 4px 16px; transition: all .25s;
}
.xb-search:focus-within { background: var(--card-bg); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(110, 168, 254, .15); }
.xb-search input { border: 0; outline: 0; background: transparent; color: inherit; width: 170px; font-size: .9rem; transition: width .32s cubic-bezier(.22,1,.36,1); }
.xb-search:focus-within input { width: 280px; }
/* 搜索页独立大搜索框：输入区填满外框，按钮贴右侧 */
.xb-search-lg { padding: 5px 6px 5px 18px; }
.xb-search-lg input, .xb-search-lg:focus-within input { flex: 1 1 auto; width: auto; min-width: 0; }
.xb-search-lg button { width: 36px; height: 36px; flex: 0 0 auto; }
.xb-search button {
    border: 0; background: var(--accent); color: #fff; width: 32px; height: 32px;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.xb-theme-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(140, 160, 230, .25);
    background: var(--card-bg); color: #f5a623; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: all .3s;
}
.xb-theme-btn:hover { transform: rotate(20deg) scale(1.06); }
.xb-theme-btn:active { transform: rotate(20deg) scale(.9); }
.xb-theme-btn i { transition: transform .4s cubic-bezier(.22,1,.36,1); }
html[data-bs-theme="dark"] .xb-theme-btn { color: #cfe0ff; }
/* 导航信箱入口：与主题按钮同尺寸，角标用警示红 */
.xb-mail-btn {
    position: relative; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(140, 160, 230, .25); background: var(--card-bg); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
    text-decoration: none; transition: transform .25s, background .25s;
}
.xb-mail-btn:hover { transform: translateY(-1px); background: rgba(110, 168, 254, .12); color: var(--accent); }
.xb-mail-badge {
    position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 9px; background: #e05d5d; color: #fff; font-size: 11px; line-height: 17px;
    font-weight: 700; text-align: center;
}
.xb-avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--accent); padding: 0; }
.xb-avatar-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* 窄屏用的搜索展开按钮：宽屏有常驻搜索框，此处不出现 */
.xb-search-btn {
    display: none; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(140, 160, 230, .25); background: var(--card-bg); color: inherit;
    align-items: center; justify-content: center; font-size: 1.05rem; cursor: pointer;
}
/* 未登录时占据右上角的账号位，与信箱/头像按钮同一槽位、同一高度 */
.xb-login-btn {
    height: 38px; padding: 0 15px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid rgba(110, 168, 254, .45); background: rgba(110, 168, 254, .12); color: var(--accent);
    font-size: .92rem; text-decoration: none; white-space: nowrap; transition: transform .25s, background .25s;
}
.xb-login-btn:hover { background: rgba(110, 168, 254, .2); color: var(--accent); transform: translateY(-1px); }

/* ---------- 窄屏（手机）导航：两行，第二行横向滑动的页签，搜索按需展开 ---------- */
@media (max-width: 767.98px) {
    :root { --nav-h: 104px; }
    .xb-nav-inner { height: auto; flex-wrap: wrap; gap: 0 10px; padding: 9px 12px; }
    .xb-logo { order: 1; }
    .xb-logo-img.is-rect { max-width: 132px; }
    .xb-search-btn { display: inline-flex; order: 2; margin-left: auto; }
    .xb-theme-btn { order: 3; }
    .xb-mail-btn { order: 4; }
    .xb-login-btn { order: 4; }
    .xb-nav-inner > .dropdown { order: 5; }
    .xb-nav-links { order: 6; flex: 1 1 100%; margin-top: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .xb-nav-links::-webkit-scrollbar { display: none; }
    .xb-pill { padding: 6px 13px; font-size: .9rem; }
    .xb-search { display: none; order: 7; flex: 1 1 100%; margin: 8px 0 0; padding: 4px 6px 4px 14px; }
    .xb-nav.is-search .xb-search { display: flex; }
    .xb-nav.is-search .xb-nav-links { display: none; }
    .xb-nav.is-search .xb-search-btn { color: var(--accent); border-color: var(--accent); }
    .xb-search input, .xb-search:focus-within input { flex: 1 1 auto; width: auto; min-width: 0; }
    .xb-search { margin-left: 0; }
}

/* ---------- Hero（参考阿里云：左对齐标题 + 按钮 + 四栏指标） ---------- */
.xb-hero {
    position: relative; overflow: hidden; margin-top: var(--nav-h);
    padding: 82px 0 52px; text-align: left;
}
/* ---------- 全站背景（铺满视口，内容透出背景） ---------- */
.xb-page-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.xb-page-bg img, .xb-page-bg video { width: 100%; height: 100%; object-fit: cover; }
.xb-page-bg::after { content: ""; position: absolute; inset: 0; background: rgba(243, 246, 252, var(--hero-overlay)); }
html[data-bs-theme="dark"] .xb-page-bg::after { background: rgba(11, 16, 32, var(--hero-overlay)); }
body.xb-has-bg { background: none; }
.xb-hero-inner { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.xb-hero-lead { max-width: 660px; }
.xb-hero-title { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 800; letter-spacing: 1px; color: var(--accent); }
.xb-hero-sub { font-size: 1rem; line-height: 1.9; color: rgba(90, 100, 140, .85); margin-top: 14px; }
html[data-bs-theme="dark"] .xb-hero-sub { color: rgba(190, 205, 255, .7); }
/* 副标题打字机：光标由脚本挂上，禁用 JS 时只显示静态文字 */
.xb-type.is-on::after {
    content: ""; display: inline-block; vertical-align: -.15em;
    width: 2px; height: 1.05em; margin-left: 4px; background: currentColor; opacity: .75;
    animation: xbCaret 1s step-end infinite;
}
.xb-type.is-typing::after { animation: none; }
@keyframes xbCaret { 0%, 49% { opacity: .75; } 50%, 100% { opacity: 0; } }
.xb-hero-act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.xb-hero-feats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 58px; }
.xb-hero-feat { padding: 2px 0 2px 26px; border-left: 1px solid rgba(120, 140, 200, .22); }
.xb-hero-feat:first-child { padding-left: 0; border-left: 0; }
.xb-hero-feat i { font-size: 1.5rem; color: var(--accent); }
.xb-hero-feat b { display: inline-block; margin-top: 12px; font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.xb-hero-feat span { font-size: .92rem; color: rgba(110, 120, 160, .9); margin-left: 6px; }
.xb-hero-feat em { display: block; margin-top: 7px; font-style: normal; font-size: .84rem; line-height: 1.6; color: rgba(110, 120, 160, .78); }
html[data-bs-theme="dark"] .xb-hero-feat { border-left-color: rgba(140, 160, 220, .18); }
html[data-bs-theme="dark"] .xb-hero-feat span, html[data-bs-theme="dark"] .xb-hero-feat em { color: rgba(185, 200, 240, .72); }
@media (max-width: 900px) {
    .xb-hero { padding-top: 56px; }
    .xb-hero-feats { grid-template-columns: 1fr 1fr; gap: 26px 0; }
    .xb-hero-feat:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
    .xb-hero-feats { grid-template-columns: 1fr; }
    .xb-hero-feat { padding-left: 0; border-left: 0; }
}

/* ---------- 卡片 / 列表 ---------- */
.xb-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 34px 18px 70px; }
/* 无 Hero 的页面（文章/搜索/用户）：主内容需避开固定导航栏 */
.xb-nav + .xb-main { padding-top: calc(var(--nav-h) + 34px); }
@media (max-width: 767.98px) { .xb-nav + .xb-main { padding-top: calc(var(--nav-h) + 16px); } }
/* 文章页：宽屏下加宽整页，正文/评论列反而收窄，侧栏贴到更右边 */
@media (min-width: 1400px) { .xb-article-page { max-width: 1480px; } }
.xb-card {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--soft);
}
.xb-card-pad { padding: 26px; }
/* 空状态：只弱化图标，卡片底色仍由后台「卡片透明度」统一控制 */
.xb-empty > i.bi:first-child { opacity: .35; }
.xb-post { display: flex; gap: 20px; padding: 22px; margin-bottom: 20px; transition: transform .25s, box-shadow .25s; }
.xb-post:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(96, 118, 204, .2); }
.xb-post-cover { flex: 0 0 220px; align-self: stretch; min-height: 138px; border-radius: 14px; overflow: hidden; background: #e6ebf4; }
.xb-post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.xb-post:hover .xb-post-cover img { transform: scale(1.06); }
.xb-post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xb-post-body .xb-meta { margin-top: auto; padding-top: 14px; }
.xb-post-title { font-size: 1.18rem; font-weight: 700; color: inherit; margin-bottom: 8px; display: block; }
.xb-post-title:hover { color: var(--accent); }
.xb-post-sum { color: rgba(90, 100, 140, .85); font-size: .92rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-bs-theme="dark"] .xb-post-cover { background: #1b2138; }
html[data-bs-theme="dark"] .xb-post-sum { color: rgba(180, 195, 235, .7); }
.xb-meta { display: flex; align-items: center; gap: 14px; font-size: .82rem; color: rgba(120, 130, 165, .85); margin-top: 12px; flex-wrap: wrap; }
.xb-meta img { width: 22px; height: 22px; border-radius: 50%; }
.xb-meta .xb-tag {
    background: rgba(110, 168, 254, .12); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: .78rem;
}
.xb-meta .xb-tag-pending { background: rgba(240, 170, 60, .16); color: #c8901f; }
.xb-meta .xb-tag-draft { background: rgba(120, 130, 165, .16); color: rgba(120, 130, 165, .95); }
.xb-badge-type { position: absolute; top: 12px; left: 12px; background: var(--accent); color: #fff; font-size: .72rem; padding: 3px 10px; border-radius: 999px; }
@media (max-width: 720px) { .xb-post { flex-direction: column; } .xb-post-cover { flex: none; width: 100%; height: 170px; } }

/* ---------- 筛选提示条 ---------- */
.xb-filter {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; padding: 12px 16px;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--soft);
}
.xb-filter-label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; opacity: .7; }
.xb-filter-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
    background: rgba(110, 168, 254, .12); color: var(--accent); font-size: .85rem; font-weight: 600;
}
.xb-filter-chip:hover { background: var(--accent); color: #fff; }
.xb-filter-chip em { font-style: normal; font-weight: 400; opacity: .65; font-size: .78rem; }
.xb-filter-chip img { width: 18px; height: 18px; border-radius: 50%; }
.xb-filter-total { margin-left: auto; font-size: .82rem; opacity: .6; }

/* ---------- 侧栏 ---------- */
.xb-side-title { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.xb-side-title i { color: var(--accent); }
.xb-cat-item { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 12px; color: inherit; margin-bottom: 4px; transition: all .2s; }
.xb-cat-item:hover, .xb-cat-item.active { background: rgba(110, 168, 254, .12); color: var(--accent); }
.xb-tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.xb-tagcloud a { background: rgba(140, 160, 230, .12); border-radius: 999px; padding: 4px 13px; font-size: .82rem; color: inherit; }
.xb-tagcloud a:hover { background: var(--accent); color: #fff; }

/* ---------- 文章页 ---------- */
.xb-article { --xb-art-pad: clamp(18px, 4vw, 48px); padding: 36px var(--xb-art-pad); }
.xb-article h1.xb-art-title { font-size: 1.9rem; font-weight: 800; line-height: 1.4; }
.xb-article-body { font-size: .95rem; line-height: 1.85; margin-top: 26px; color: inherit; overflow-wrap: break-word; }
.xb-article-body p { margin-bottom: 1.1em; }
.xb-article-body img { max-width: 100%; border-radius: 14px; }
.xb-article-body .blk-img figcaption { text-align: center; font-size: .85rem; color: rgba(120, 130, 165, .8); margin-top: 8px; }
.xb-article-body .blk-h { font-weight: 800; margin: 1.6em 0 .8em; padding-left: 12px; border-left: 4px solid var(--accent); }
.xb-article-body blockquote {
    border-left: 4px solid var(--accent); background: rgba(110, 168, 254, .08);
    padding: 14px 18px; border-radius: 0 12px 12px 0; color: rgba(90, 100, 140, .95); margin: 1.2em 0;
}
.xb-article-body pre.blk-code {
    background: #1e2438; color: #d7e0ff; padding: 18px; border-radius: 14px; overflow-x: auto; font-size: .9rem;
}
/* 组件：Markdown 文档 */
.comp-md { margin: 1.2em 0; }
.comp-md > :first-child { margin-top: 0; }
.comp-md > :last-child { margin-bottom: 0; }
.comp-md ul, .comp-md ol { padding-left: 1.6em; margin: 0 0 1.1em; }
.comp-md li { margin-bottom: .3em; }
.comp-md code {
    background: rgba(110, 168, 254, .12); border-radius: 6px; padding: 2px 6px;
    font-size: .88em; color: var(--bs-body-color);
}
.comp-md pre.blk-code code { background: transparent; padding: 0; }
.comp-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.comp-md table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .92rem; }
.comp-md th, .comp-md td { border: 1px solid var(--card-border); padding: 8px 12px; text-align: left; }
.comp-md th { background: rgba(140, 160, 230, .1); font-weight: 700; }
.comp-md hr { border: 0; border-top: 1px solid var(--card-border); margin: 1.6em 0; }
.comp-md img { max-width: 100%; border-radius: 14px; }
/* 组件：视频 */
.comp-video video { width: 100%; border-radius: 16px; box-shadow: var(--soft); display: block; margin: 1.2em 0; }
/* 组件：音频 */
.comp-audio {
    display: flex; align-items: center; gap: 12px; margin: 1.2em 0; padding: 14px 16px;
    border: 1px solid var(--card-border); border-radius: 16px; background: var(--card-bg); box-shadow: var(--soft);
}
.comp-audio-ico {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: rgba(110, 168, 254, .12); color: var(--accent); font-size: 1.15rem;
}
.comp-audio-main { flex: 1; min-width: 0; }
.comp-audio-name { font-weight: 700; font-size: .92rem; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-audio audio { display: block; width: 100%; height: 38px; }
/* 组件：网页嵌入 */
.comp-embed {
    margin: 1.2em 0; border: 1px solid var(--card-border); border-radius: 16px;
    overflow: hidden; background: var(--card-bg); box-shadow: var(--soft);
}
.comp-embed iframe { display: block; width: 100%; border: 0; }
/* 嵌入标题条：编辑器里填的「名称」显示在窗口上方 */
.comp-embed-cap {
    display: flex; align-items: center; gap: 8px; padding: 11px 16px;
    font-weight: 700; border-bottom: 1px solid var(--card-border);
}
.comp-embed-cap i { color: var(--accent); }
/* 铺满卡片：媒体块用负外边距抵掉卡片左右内边距，正好贴到卡片内边缘，不再凸出卡片 */
.xb-article-body .comp-embed.is-wide {
    margin-left: calc(-1 * var(--xb-art-pad));
    margin-right: calc(-1 * var(--xb-art-pad));
    border-left: 0; border-right: 0; border-radius: 0; box-shadow: none;
}
/* 组件：下载卡片 */
.comp-dl {
    display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin: 1.2em 0;
    background: rgba(110, 168, 254, .07);
    border: 1px dashed rgba(110, 168, 254, .5); border-radius: 12px;
}
.comp-dl > i { font-size: 1.7rem; color: var(--accent); }
.comp-dl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.comp-dl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-dl-size { font-size: .8rem; color: rgba(120, 130, 165, .85); }
.comp-dl-btn { border-radius: 999px; background: var(--accent); color: #fff; border: 0; padding: 6px 18px !important; transition: filter .2s; }
.comp-dl-btn:hover { background: var(--accent); color: #fff; filter: brightness(.9); }
/* 下载门槛：登录 / 访问密码 */
.comp-dl-lock { flex-wrap: wrap; }
.comp-dl-hint { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: rgba(120, 130, 165, .9); }
.comp-dl-form { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; margin-top: 12px; }
.comp-dl-form .form-control { flex: 1 1 200px; min-width: 0; max-width: 280px; }
/* 组件：超链接卡片 */
a.comp-link {
    display: inline-flex; align-items: center; gap: 8px; margin: .6em 1.2em .6em 0; padding: 9px 18px;
    border-radius: 999px; background: rgba(110, 168, 254, .12); color: var(--accent); border: 1px solid rgba(110, 168, 254, .3);
    transition: all .2s;
}
a.comp-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-1px); }
/* 组件：轮播图 */
.comp-carousel { margin: 1.4em 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--card-border); background: var(--card-bg); }
/* Bootstrap 在「减少动态效果」下把 .carousel-item 的过渡整体关成 transition:none，切换就成了硬跳；
   这里按组件重声明一遍（选择器更具体，能盖掉那条），保证左右推入始终看得见 */
.comp-carousel .carousel-item { transition: transform .55s ease-in-out; backface-visibility: hidden; }
.comp-carousel .carousel-item img { width: 100%; height: clamp(200px, 40vh, 440px); object-fit: cover; display: block; }
.comp-carousel .carousel-caption { position: static; padding: 10px 16px; text-align: left; font-size: .88rem; color: var(--bs-body-color); text-shadow: none; background: var(--card-bg); border-top: 1px solid var(--card-border); }
html[data-bs-theme="dark"] .comp-carousel .carousel-caption { color: var(--bs-body-color); }
/* 组件：图库 */
.comp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 1.4em 0; }
.comp-gal-item { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--card-border); }
.comp-gal-item img { width: 100%; height: 140px; object-fit: cover; display: block; cursor: zoom-in; transition: transform .25s; }
.comp-gal-item:hover img { transform: scale(1.05); }
/* 图库灯箱 */
.xb-lb { position: fixed; inset: 0; z-index: 1080; background: rgba(10, 14, 26, .9); display: none; align-items: center; justify-content: center; }
.xb-lb.show { display: flex; }
.xb-lb-img { max-width: 88vw; max-height: 78vh; border-radius: 10px; }
.xb-lb-cap { position: absolute; left: 0; right: 0; bottom: 22px; padding: 0 64px; text-align: center; color: rgba(255, 255, 255, .88); font-size: .9rem; }
.xb-lb-count { position: absolute; left: 22px; top: 24px; color: rgba(255, 255, 255, .68); font-size: .85rem; }
.xb-lb-btn { position: absolute; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; }
.xb-lb-btn:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.xb-lb-prev { left: 20px; top: 50%; margin-top: -21px; }
.xb-lb-next { right: 20px; top: 50%; margin-top: -21px; }
.xb-lb-close { right: 20px; top: 20px; }
html.xb-lb-open { overflow: hidden; }

/* ---------- 评论气泡 ---------- */
.xb-cmt { display: flex; gap: 14px; margin-bottom: 22px; }
.xb-cmt-avatar { flex: 0 0 46px; }
.xb-cmt-avatar img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(110, 168, 254, .4); }
.xb-cmt-bubble {
    position: relative; flex: 1; background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 4px 18px 18px 18px; padding: 12px 16px; box-shadow: 0 4px 16px rgba(96, 118, 204, .08);
}
.xb-cmt-bubble::before {
    content: ""; position: absolute; left: -8px; top: 0; border: 8px solid transparent;
    border-top-color: rgba(255, 255, 255, .65); border-right-color: transparent; border-bottom: 0; transform: rotate(45deg) translate(-4px, 4px);
}
html[data-bs-theme="dark"] .xb-cmt-bubble::before { border-top-color: rgba(40, 48, 78, .55); }
.xb-cmt-head { display: flex; align-items: center; gap: 10px; font-size: .85rem; flex-wrap: wrap; }
.xb-cmt-name { font-weight: 700; color: var(--accent); }
.xb-cmt-ip { background: rgba(110, 168, 254, .12); color: rgba(110, 168, 254, .95); border-radius: 999px; padding: 1px 9px; font-size: .72rem; }
.xb-cmt-date { color: rgba(120, 130, 165, .8); font-size: .78rem; }
.xb-cmt-content { margin-top: 6px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.xb-cmt-reply { font-size: .8rem; color: rgba(120, 130, 165, .9); cursor: pointer; }
.xb-cmt-reply:hover { color: var(--accent); }
.xb-cmt-children { margin-top: 16px; padding-left: 26px; border-left: 2px dashed rgba(110, 168, 254, .25); }
.xb-cmt-children .xb-cmt-avatar { flex-basis: 36px; }
.xb-cmt-children .xb-cmt-avatar img { width: 36px; height: 36px; }
.xb-cmt-login-tip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 20px; border: 1px dashed var(--card-border); border-radius: 14px; color: rgba(110, 120, 160, .9); }
.xb-cmt-login-tip i { color: var(--accent); }

/* ---------- 分页 / 按钮 ---------- */
.xb-pager { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.xb-pager a, .xb-pager span {
    min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; background: var(--card-bg); color: inherit; border: 1px solid var(--card-border); font-size: .9rem; padding: 0 10px;
}
.xb-pager .cur { background: var(--accent); color: #fff; border: 0; }
.xb-pager .dot { background: none; border: 0; min-width: 18px; opacity: .55; }
.btn-xb { border-radius: 999px; background: var(--accent); color: #fff; border: 0; padding: 9px 26px; transition: filter .2s, transform .2s; }
.btn-xb:hover { color: #fff; filter: brightness(.9); transform: translateY(-1px); }
.btn-xb:focus, .btn-xb:active, .btn-xb.active { color: #fff; background-color: var(--accent); border-color: transparent; box-shadow: none; filter: brightness(.86); }
.btn-xb-line { border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); background: transparent; padding: 8px 24px; }
.btn-xb-line:hover { background: rgba(110, 168, 254, .12); color: var(--accent); }
.btn-xb-line:focus, .btn-xb-line:active, .btn-xb-line.active { background: rgba(110, 168, 254, .18); color: var(--accent); border-color: var(--accent); box-shadow: none; }
.xb-nav-menu { border-radius: 14px; border-color: var(--card-border); background: var(--card-bg); }
.xb-nav-menu .dropdown-item { color: inherit; }
.xb-nav-menu .dropdown-item:hover { background: rgba(110, 168, 254, .12); color: var(--accent); }
.xb-nav-menu .dropdown-item.text-danger:hover { background: rgba(217, 83, 79, .1); color: #d9534f; }

/* ---------- 表单 ---------- */
.xb-form .form-control, .xb-form .form-select {
    background: rgba(140, 160, 230, .08); border: 1px solid rgba(140, 160, 230, .25); border-radius: 12px; color: inherit; padding: 10px 14px;
}
.xb-form .form-control:focus { background: var(--card-bg); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(110, 168, 254, .15); color: inherit; }
.xb-auth-wrap { width: 100%; max-width: 460px; margin: 10vh auto 0; }
.xb-auth-wrap .xb-card-pad { padding: 38px 36px; }
.xb-auth-title { text-align: center; font-weight: 800; font-size: 1.7rem; margin-bottom: 6px; }
.xb-auth-sub { text-align: center; color: rgba(120, 130, 165, .8); font-size: .95rem; margin-bottom: 30px; }
/* 登录页：左文章 / 右登录 */
.xb-auth-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 26px; align-items: start; max-width: 1000px; margin: 4vh auto 0; }
.xb-auth-grid.no-side { grid-template-columns: 420px; justify-content: center; }
.xb-auth-card { padding: 34px 32px; }
.xb-auth-item { display: block; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; color: inherit; transition: border-color .2s, transform .2s; }
.xb-auth-item:hover { border-color: var(--accent); transform: translateX(3px); color: inherit; }
.xb-auth-item .t { display: block; font-weight: 700; margin-bottom: 4px; }
.xb-auth-item .s { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .86rem; line-height: 1.6; opacity: .72; }
.xb-auth-item .m { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .78rem; opacity: .62; }
.xb-auth-item .m em { font-style: normal; margin-left: auto; background: rgba(110, 168, 254, .12); color: var(--accent); border-radius: 999px; padding: 1px 9px; }
.xb-auth-more { font-size: .86rem; opacity: .75; text-decoration: none; }
.xb-auth-more:hover { opacity: 1; color: var(--accent); }
@media (max-width: 900px) { .xb-auth-grid { grid-template-columns: 1fr; } .xb-auth-grid.no-side { grid-template-columns: 1fr; } }

/* ---------- 页脚 ---------- */
.xb-footer { border-top: 1px solid rgba(140, 160, 230, .15); background: rgba(var(--foot-rgb), var(--foot-alpha)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 26px 0; margin-top: auto; }
html[data-bs-theme="dark"] .xb-footer { --foot-rgb: 16, 21, 40; }
.xb-footer a { color: inherit; opacity: .8; }
.xb-footer a:hover { color: var(--accent); opacity: 1; }
.xb-footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 18px; font-size: .9rem; }
.xb-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 1.2fr; gap: 28px; align-items: start; text-align: left; }
@media (max-width: 860px) { .xb-foot-grid { grid-template-columns: 1fr 1fr; gap: 22px; } }
@media (max-width: 560px) { .xb-foot-grid { grid-template-columns: 1fr; } }
.xb-foot-col { min-width: 0; }
.xb-foot-title { font-size: .82rem; font-weight: 700; color: var(--accent); margin: 0 0 12px; display: flex; align-items: center; gap: 6px; letter-spacing: .5px; }
.xb-foot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.xb-foot-list a { opacity: .82; }
.xb-foot-desc { margin: 0; line-height: 1.7; opacity: .78; }
.xb-foot-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.xb-foot-brand .xb-logo-img.is-square { height: 34px; width: 34px; }
.xb-foot-brand .xb-logo-img.is-rect { height: 32px; }
.xb-foot-sub { margin: 10px 0 0; opacity: .7; line-height: 1.6; }
.xb-foot-meta { text-align: right; }
@media (max-width: 560px) { .xb-foot-meta { text-align: left; } }
.xb-foot-copy { margin: 0 0 6px; font-weight: 600; opacity: .9; }
.xb-foot-links { margin: 0; line-height: 1.9; opacity: .72; }
.xb-foot-icp { margin: 8px 0 0; font-size: .8rem; opacity: .6; }
.xb-foot-icp a { display: inline-flex; align-items: center; gap: 5px; }

/* 回到顶部 */
.xb-top {
    position: fixed; right: 26px; bottom: 30px; width: 44px; height: 44px; border-radius: 50%;
    background: var(--accent); color: #fff; border: 0; display: none; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(30, 40, 70, .22); z-index: 1020;
}
.xb-top.show { display: inline-flex; }

/* 过渡动画 */
.xb-fade { animation: xbFade .5s ease both; }
@keyframes xbFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 主题切换交叉淡入（回退方案） */
body { transition: opacity .18s ease; }
html.xb-theme-anim body { opacity: 0; }
/* 支持 View Transition 的浏览器：整页交叉淡入 */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .32s; }

/* ---------- 页面组件（侧边栏 / 制作者信息栏 / 文章列表 / 自定义 HTML） ---------- */
.comp-side, .comp-list, .comp-author, .comp-raw {
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
    box-shadow: var(--soft); padding: 22px; margin: 0 0 20px;
}
/* 侧栏里组件紧跟内置卡片时也要留出间距（相邻外边距自动折叠，不会翻倍） */
* + .comp-side, * + .comp-list, * + .comp-author, * + .comp-raw { margin-top: 20px; }
.comp-side-title { font-weight: 700; font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.comp-side-title::before { content: ''; width: 4px; height: 15px; border-radius: 2px; background: var(--accent); }
.comp-side-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: inherit; margin-bottom: 4px; transition: all .2s; }
.comp-side-item:hover { background: rgba(110, 168, 254, .12); color: var(--accent); }
.comp-side-item i { opacity: .45; }
.comp-list-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; color: inherit; font-size: .92rem; border-bottom: 1px dashed var(--card-border); }
.comp-list-item:last-child { border-bottom: 0; }
.comp-list-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-list-item em { font-style: normal; font-size: .78rem; opacity: .55; white-space: nowrap; }
.comp-list-item:hover span { color: var(--accent); }
.comp-list-empty { font-size: .88rem; opacity: .6; }
.comp-author { display: flex; align-items: center; gap: 14px; }
.comp-author > img { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.comp-author-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.comp-author-info b { font-weight: 700; }
.comp-author-info span { font-size: .82rem; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-author-info em { font-style: normal; font-size: .78rem; color: var(--accent); }
.comp-author-more { flex: none; font-size: .8rem; padding: 5px 14px; border-radius: 999px; background: rgba(110, 168, 254, .12); color: var(--accent); white-space: nowrap; }
.comp-author-more:hover { background: var(--accent); color: #fff; }
.comp-raw > :first-child { margin-top: 0; }
.comp-raw > :last-child { margin-bottom: 0; }

/* ---------- 站内信箱 ---------- */
.xb-mail-row { padding: 13px 0; border-bottom: 1px dashed var(--card-border); }
.xb-mail-row:first-child { padding-top: 2px; }
.xb-mail-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.xb-mail-dot { width: 8px; height: 8px; border-radius: 50%; background: #e05d5d; flex: none; }
.xb-mail-title { font-weight: 700; color: inherit; }
.xb-mail-title:hover { color: var(--accent); }
.xb-mail-row.is-unread .xb-mail-title { color: var(--accent); }
.xb-mail-from { font-size: .8rem; opacity: .6; }
.xb-mail-date { font-size: .8rem; opacity: .55; margin-left: auto; white-space: nowrap; }
.xb-mail-excerpt { margin-top: 5px; font-size: .88rem; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xb-mail-view { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: .78rem; color: inherit; opacity: .72; padding: 2px 9px; border: 1px solid var(--bs-border-color); border-radius: 7px; }
.xb-mail-view:hover { opacity: 1; color: var(--accent); border-color: var(--accent); background: rgba(110, 168, 254, .1); }
.xb-mail-del { border: 0; background: transparent; color: inherit; opacity: .4; padding: 2px 7px; border-radius: 7px; cursor: pointer; }
.xb-mail-del:hover { opacity: 1; color: #e05d5d; background: rgba(224, 93, 93, .1); }
.xb-mail-body { line-height: 1.85; font-size: .95rem; }

/* 新邮件通知：macOS 风格，从屏幕右侧外推入，底部一条倒计时进度条 */
.xb-toast-wrap { position: fixed; top: 74px; right: 16px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.xb-toast {
    pointer-events: auto; position: relative; width: 340px; max-width: calc(100vw - 32px);
    background: var(--card-bg); color: var(--bs-body-color); border: 1px solid var(--card-border);
    border-radius: 14px; box-shadow: 0 10px 28px rgba(16, 24, 40, .18);
    padding: 12px 14px 12px; overflow: hidden;
    transform: translateX(calc(100% + 24px)); opacity: 0;
    transition: transform .42s cubic-bezier(.22, 1, .36, 1), opacity .3s ease;
}
.xb-toast.is-in { transform: none; opacity: 1; }
.xb-toast.is-out { transform: translateX(calc(100% + 24px)); opacity: 0; }
.xb-toast-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.xb-toast-ico { width: 28px; height: 28px; border-radius: 8px; flex: none; background: rgba(110, 168, 254, .14); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.xb-toast-label { font-size: .76rem; letter-spacing: .04em; opacity: .6; }
.xb-toast-title { font-weight: 700; font-size: .92rem; line-height: 1.4; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xb-toast-ft { display: flex; justify-content: flex-end; gap: 8px; }
.xb-toast-btn { font-size: .82rem; border-radius: 8px; padding: 4px 13px; cursor: pointer; border: 1px solid var(--card-border); background: transparent; color: inherit; }
.xb-toast-btn:hover { background: rgba(110, 168, 254, .1); }
.xb-toast-btn.is-main { background: var(--accent); border-color: var(--accent); color: #fff; }
a.xb-toast-btn { text-decoration: none; display: inline-block; }
.xb-toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(110, 168, 254, .18); }
.xb-toast-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left center; animation: xbToastCount linear forwards; }
/* 鼠标停在通知上时冻结倒计时，免得正要点查看就消失了 */
.xb-toast:hover .xb-toast-bar i { animation-play-state: paused; }
@keyframes xbToastCount { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 575.98px) {
    .xb-toast-wrap { left: 12px; right: 12px; top: 66px; }
    .xb-toast { width: auto; }
}

/* ---------- 手机端（≤576px）：收紧留白与字号，让正文/评论/组件都留在屏内 ---------- */
@media (max-width: 575.98px) {
    .xb-hero { padding: 30px 0 26px; }
    .xb-hero-inner { padding: 0 14px; }
    .xb-hero-act { margin-top: 20px; }
    .xb-hero-feats { margin-top: 30px; }
    .xb-main { padding: 20px 12px 46px; }
    .xb-card-pad { padding: 18px 14px; }
    .xb-post { padding: 15px 14px; margin-bottom: 14px; gap: 14px; }
    .xb-post-cover { height: 152px; min-height: 0; }
    .xb-post-title { font-size: 1.05rem; margin-bottom: 6px; }
    .xb-filter { padding: 10px 12px; gap: 8px; }
    .xb-filter-total { margin-left: 0; flex: 1 1 100%; }
    .xb-article { --xb-art-pad: 14px; padding: 22px var(--xb-art-pad); }
    .xb-article h1.xb-art-title { font-size: 1.45rem; letter-spacing: 0; line-height: 1.35; }
    .xb-article-body { font-size: .93rem; line-height: 1.8; margin-top: 18px; }
    .xb-article-body blockquote { padding: 11px 13px; }
    .xb-article-body pre.blk-code { padding: 13px; font-size: .8rem; }
    .comp-md th, .comp-md td { padding: 6px 9px; font-size: .86rem; }
    .comp-md table { font-size: .86rem; }
    .comp-gal-item img { height: 96px; }
    .comp-gallery { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 7px; }
    .comp-carousel .carousel-caption { padding: 9px 12px; font-size: .82rem; }
    .comp-audio { padding: 12px 13px; gap: 10px; }
    .comp-embed-cap { padding: 9px 12px; font-size: .9rem; }
    .comp-dl { padding: 13px 14px; gap: 10px; }
    .comp-dl > i { font-size: 1.4rem; }
    .comp-dl-btn { padding: 5px 14px !important; }
    .comp-side, .comp-list, .comp-author, .comp-raw { padding: 16px 14px; }
    .comp-author > img { width: 42px; height: 42px; }
    .comp-list-item { font-size: .88rem; }
    /* 灯箱：按钮贴边、说明文字不再被两侧按钮夹住 */
    .xb-lb-img { max-width: 94vw; }
    .xb-lb-cap { padding: 0 14px; bottom: 14px; font-size: .82rem; }
    .xb-lb-count { left: 14px; top: 14px; font-size: .78rem; }
    .xb-lb-btn { width: 34px; height: 34px; font-size: .92rem; }
    .xb-lb-prev { left: 8px; margin-top: -17px; }
    .xb-lb-next { right: 8px; margin-top: -17px; }
    .xb-lb-close { right: 10px; top: 12px; }
    /* 评论：头像和子级缩进收窄，窄屏不至于把正文挤成竖排 */
    .xb-cmt { gap: 10px; margin-bottom: 16px; }
    .xb-cmt-avatar { flex-basis: 34px; }
    .xb-cmt-avatar img { width: 34px; height: 34px; }
    .xb-cmt-bubble { padding: 10px 12px; border-radius: 4px 14px 14px 14px; }
    .xb-cmt-children { padding-left: 12px; margin-top: 12px; }
    .xb-cmt-login-tip { padding: 12px 14px; }
    .xb-pager { gap: 5px; margin-top: 22px; }
    .xb-pager a, .xb-pager span { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; font-size: .82rem; }
    .btn-xb { padding: 8px 20px; }
    .btn-xb-line { padding: 7px 18px; }
    /* 登录 / 注册：卡片留白与标题收紧 */
    .xb-auth-wrap { margin-top: 24px; }
    .xb-auth-card { padding: 24px 18px; }
    .xb-auth-wrap .xb-card-pad { padding: 24px 18px; }
    .xb-auth-grid { margin-top: 24px; }
    .xb-auth-title { font-size: 1.4rem; }
    .xb-auth-sub { font-size: .88rem; margin-bottom: 20px; }
    /* 信箱：日期换到下一行，长标题不再被压成省略号 */
    .xb-mail-date { margin-left: 0; flex: 1 1 100%; }
    .xb-footer { padding: 22px 0; }
    .xb-footer-inner { padding: 0 14px; }
    .xb-top { right: 14px; bottom: 18px; width: 40px; height: 40px; }
}
