/* ==========================================================================
   Xidle（半日闲）— Typecho 主题样式
   温暖、闲适、留白的阅读氛围；支持 浅色 / 深色 / 跟随系统
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */
:root {
    /* 暖调纸张配色 */
    --bg: #faf7f0;
    --surface: #fffdf8;
    --surface-2: #f3ede1;
    --text: #3a352e;
    --text-muted: #857c70;
    --text-faint: #a99f92;
    --border: #ece5d8;
    --border-strong: #ded4c2;
    --accent: #b5763f;
    --accent-strong: #965c2c;
    --accent-soft: rgba(181, 118, 63, 0.10);
    --danger: #b95b4d;
    --shadow-sm: 0 1px 2px rgba(90, 70, 40, 0.05);
    --shadow: 0 2px 4px rgba(90, 70, 40, 0.06), 0 10px 26px rgba(90, 70, 40, 0.07);

    --radius: 16px;
    --radius-sm: 10px;

    --rail-w: 60px;
    --gutter: 20px;
    --pad: 30px;
    --header-h: 62px;
    --content-max: 1104px;
    --sidebar-w: 288px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
    --bg: #1b1916;
    --surface: #24211d;
    --surface-2: #2c2823;
    --text: #ded8cd;
    --text-muted: #9b9286;
    --text-faint: #6f695f;
    --border: #322e28;
    --border-strong: #423c34;
    --accent: #d09a63;
    --accent-strong: #e0b07c;
    --accent-soft: rgba(208, 154, 99, 0.14);
    --danger: #e08078;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg: #1b1916;
        --surface: #24211d;
        --surface-2: #2c2823;
        --text: #ded8cd;
        --text-muted: #9b9286;
        --text-faint: #6f695f;
        --border: #322e28;
        --border-strong: #423c34;
        --accent: #d09a63;
        --accent-strong: #e0b07c;
        --accent-soft: rgba(208, 154, 99, 0.14);
        --danger: #e08078;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.35);
    }
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.xidle-body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.35; }

.xidle-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

.xidle-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    z-index: 999;
}
.xidle-skip:focus { left: 8px; top: 8px; }

/* --------------------------------------------------------------------------
   3. 布局骨架：整体居中，竖线 + 内容 + 侧栏一同居中；左侧图标栏浮在竖线左侧
   -------------------------------------------------------------------------- */
.xidle-layout { position: relative; }

.xidle-main-area {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.xidle-content-row {
    display: flex;
    gap: 38px;
    position: relative;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 30px var(--pad) 48px;
    align-items: flex-start;
    /* 竖线：位于列表左缘，贯穿内容区直到页脚 */
    border-left: 1px solid var(--border);
}

.xidle-content {
    position: relative;
    flex: 1;
    min-width: 0;
}

.xidle-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-h) + 22px);
}

/* --------------------------------------------------------------------------
   4. 左侧浮动图标栏
   定位：相对「居中的内容容器」计算，浮在竖线左侧、随内容居中；悬停显示文字气泡
   -------------------------------------------------------------------------- */
.xidle-rail {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: calc(50% - (var(--content-max) / 2) - var(--rail-w) - 20px);
    width: var(--rail-w);
    z-index: 20;
    /* 空白区域不拦截点击，避免遮挡页脚登录等元素 */
    pointer-events: none;
}
.xidle-rail a,
.xidle-rail button { pointer-events: auto; }

.xidle-rail-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
}

.xidle-rail-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.xidle-rail-profile { position: relative; pointer-events: auto; }

.xidle-rail-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow);
    background: var(--surface-2);
    transition: transform 0.25s ease;
}
.xidle-rail-avatar:hover img { transform: scale(1.06) rotate(-2deg); }

/* 头像悬停资料卡：向下展开，与头像顶部对齐 */
.xidle-profile-card {
    position: absolute;
    left: 100%;
    top: 0;
    transform: translateX(2px);
    width: 268px;
    margin-left: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 90;
}
/* 桥接区：填平头像与资料卡之间的间隙 */
.xidle-profile-card::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 15px;
}
/* 指向头像的小箭头 */
.xidle-profile-card::after {
    content: "";
    position: absolute;
    left: -5px;
    top: 21px;
    width: 9px;
    height: 9px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
}
.xidle-rail-profile:hover .xidle-profile-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}
.xidle-profile-head { display: flex; align-items: center; gap: 12px; }
.xidle-profile-meta { display: flex; flex-direction: column; min-width: 0; }
.xidle-profile-name { font-size: 15px; color: var(--text); }
.xidle-profile-sign {
    font-size: 12.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xidle-profile-bio {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    max-height: 132px;
    overflow-y: auto;
}
.xidle-profile-bio p { margin: 0 0 0.6em; }
.xidle-profile-bio p:last-child { margin-bottom: 0; }
.xidle-profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.xidle-profile-links a,
.xidle-profile-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-muted);
    transition: background-color 0.18s ease, color 0.18s ease;
}
.xidle-profile-links a:hover { background: var(--accent); color: #fff; }
.xidle-profile-social { cursor: default; }

.xidle-rail-nav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.xidle-rail-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 12px;
    color: var(--text-muted);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.xidle-rail-link:hover { background: var(--surface-2); color: var(--accent); transform: translateY(-1px); }
.xidle-rail-link.is-active { color: var(--accent); background: var(--accent-soft); }

/* 悬停提示气泡 */
.xidle-tip {
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    white-space: nowrap;
    padding: 5px 11px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 80;
}
.xidle-rail-link:hover .xidle-tip,
.xidle-rail-link:focus-visible .xidle-tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.xidle-rail-mask {
    position: fixed;
    inset: 0;
    background: rgba(40, 32, 20, 0.42);
    z-index: 55;
    backdrop-filter: blur(2px);
}

/* 主题图标三态 */
.xidle-theme-icon { display: none; align-items: center; justify-content: center; }
[data-theme="light"] .xidle-theme-icon[data-theme-icon="light"],
[data-theme="dark"] .xidle-theme-icon[data-theme-icon="dark"],
[data-theme="auto"] .xidle-theme-icon[data-theme-icon="auto"] { display: inline-flex; }

/* --------------------------------------------------------------------------
   5. 顶部导航（站点标题 + 分类 + 搜索）
   -------------------------------------------------------------------------- */
.xidle-topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.xidle-topnav-inner {
    display: grid;
    grid-template-columns: 1fr minmax(0, var(--content-max)) 1fr;
    align-items: center;
    height: var(--header-h);
    padding: 0 var(--pad);
}

/* 标题所在左侧区：右对齐到竖线 */
.xidle-topnav-left {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    padding-right: 20px;
}

/* 分类 + 搜索 + 主题，位于居中主列 */
.xidle-topnav-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 0 var(--pad);
}

.xidle-brand { display: flex; align-items: center; min-width: 0; max-width: 100%; }
.xidle-brand-text {
    font-family: var(--font-serif);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text);
}
.xidle-brand:hover .xidle-brand-text { color: var(--accent); }
/* max-width:100% 让 LOGO 在窄栏内等比缩小，避免溢出压到导航 */
.xidle-brand-logo { max-height: 40px; max-width: 100%; width: auto; height: auto; }

/* 内置 logo 随主题切换（深色用浅色版） */
.xidle-logo-dark { display: none; }
[data-theme="dark"] .xidle-logo-light { display: none; }
[data-theme="dark"] .xidle-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .xidle-logo-light { display: none; }
    [data-theme="auto"] .xidle-logo-dark { display: block; }
}

.xidle-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 12px;
    color: var(--text-muted);
}
.xidle-menu-toggle:hover { background: var(--surface-2); color: var(--accent); }

.xidle-topnav-nav { flex: 1; min-width: 0; }
.xidle-topnav-list { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.xidle-nav-item { position: relative; }
.xidle-nav-item > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    color: var(--text-muted);
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.xidle-nav-item > a:hover { background: var(--surface-2); color: var(--text); }
.xidle-nav-item.is-active > a { color: var(--accent); font-weight: 600; }

.xidle-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 148px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    flex-direction: column;
    z-index: 30;
}
/* 透明桥接：填平下拉与菜单之间的间隙，避免鼠标移动途中丢失 hover */
.xidle-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}
.xidle-nav-item.has-children:hover .xidle-dropdown { display: flex; }
.xidle-dropdown a {
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 14px;
    color: var(--text-muted);
}
.xidle-dropdown a:hover { background: var(--surface-2); color: var(--accent); }

/* 页头右侧按钮（搜索 / 主题切换） */
.xidle-topbtn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 15px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13.5px;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.xidle-topbtn:hover { border-color: var(--accent); color: var(--accent); }
.xidle-theme-toggle { width: 38px; padding: 0; }
.xidle-theme-toggle .xidle-icon { display: block; }

/* 主题切换下拉 */
.xidle-theme { position: relative; }
.xidle-theme-menu {
    left: auto;
    right: 0;
    min-width: 132px;
    display: flex;
}
.xidle-theme-menu[hidden] { display: none; }
.xidle-theme-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 13.5px;
    text-align: left;
}
.xidle-theme-menu button:hover { background: var(--surface-2); color: var(--accent); }
.xidle-theme-menu button.is-active { color: var(--accent); font-weight: 600; }
.xidle-theme-menu button svg { color: var(--text-faint); }
.xidle-theme-menu button.is-active svg { color: var(--accent); }

.xidle-searchbar { border-top: 1px solid var(--border); background: var(--bg); }
.xidle-searchbar form {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 12px var(--pad);
}
.xidle-searchbar input {
    flex: 1;
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    outline: none;
}
.xidle-searchbar input:focus { border-color: var(--accent); }
.xidle-searchbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
}

/* --------------------------------------------------------------------------
   6. 文章列表
   -------------------------------------------------------------------------- */
.xidle-stat {
    font-size: 13px;
    color: var(--text-faint);
    padding: 2px 2px 18px;
}

.xidle-posts { display: flex; flex-direction: column; gap: 18px; }

.xidle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.xidle-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}

.xidle-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.xidle-card-title { font-size: 19px; font-weight: 700; line-height: 1.5; }
.xidle-card-title a { color: var(--text); transition: color 0.18s ease; }
.xidle-card-title a:hover { color: var(--accent); }
.xidle-card-pin {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    color: var(--accent);
    vertical-align: -2px;
}
.xidle-card-date { flex-shrink: 0; font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.xidle-card-body { display: flex; gap: 18px; align-items: flex-start; }

.xidle-card-thumb {
    flex-shrink: 0;
    width: 128px;
    height: 88px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
}
.xidle-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.xidle-card:hover .xidle-card-thumb img { transform: scale(1.05); }

.xidle-card-excerpt {
    flex: 1;
    min-width: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.xidle-card-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 12.5px;
    color: var(--text-faint);
}
.xidle-card-cat { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); }
.xidle-card-cat a:hover { color: var(--accent); }
.xidle-card-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.xidle-card-tags a {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
}
.xidle-card-tags a:hover { background: var(--accent); color: #fff; }
.xidle-card-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 14px; }
.xidle-card-meta a,
.xidle-card-meta .xidle-card-views { display: inline-flex; align-items: center; gap: 5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.xidle-card-meta a:hover { color: var(--accent); }

.xidle-empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   7. 归档 / 搜索标题
   -------------------------------------------------------------------------- */
.xidle-archive-head { margin-bottom: 20px; }
.xidle-archive-title { display: flex; align-items: center; gap: 8px; font-size: 20px; color: var(--text); }
.xidle-archive-ico { display: inline-flex; color: var(--accent); }
.xidle-archive-name { font-weight: 700; }
.xidle-archive-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.xidle-archive-desc { margin: 8px 0 0; color: var(--text-muted); font-size: 13.5px; }

/* --------------------------------------------------------------------------
   8. 右侧边栏
   -------------------------------------------------------------------------- */
.xidle-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.xidle-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 14px;
    color: var(--text);
}
.xidle-widget-title svg { color: var(--accent); }

.xidle-hot li,
.xidle-recent-comments li {
    display: flex;
    gap: 8px;
    padding: 7px 0;
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid var(--border);
}
.xidle-hot li:last-child,
.xidle-recent-comments li:last-child { border-bottom: none; }
.xidle-hot a, .xidle-recent-comments a {
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.xidle-hot a:hover, .xidle-recent-comments a:hover { color: var(--accent); }
.xidle-rank {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 18px;
}
.xidle-rank.is-top { background: var(--accent); color: #fff; }

.xidle-archive { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.xidle-archive li { min-width: 0; }
.xidle-archive a {
    display: block;
    padding: 4px 6px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 12.5px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xidle-archive a:hover { background: var(--accent); color: #fff; }

.xidle-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.xidle-tags a {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 13px;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.xidle-tags a:hover { background: var(--accent); color: #fff; }

.xidle-links li { padding: 6px 0; }
.xidle-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 14px; }
.xidle-links a:hover { color: var(--accent); }
.xidle-links a svg { color: var(--text-faint); }

.xidle-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    font-size: 13.5px;
    color: var(--text-muted);
}
.xidle-stats li { display: inline-flex; align-items: center; gap: 2px; }
.xidle-stats-num {
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.xidle-widget-empty { margin: 0; font-size: 13.5px; color: var(--text-faint); }

/* 文章导读（目录） */
.xidle-toc-list { list-style: none; margin: 0; padding: 0; }
.xidle-toc-item a {
    display: block;
    padding: 5px 10px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.55;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.xidle-toc-item a:hover { color: var(--accent); background: var(--surface-2); }
.xidle-toc-item a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.xidle-toc-h3 a { padding-left: 24px; }
.xidle-toc-h4 a { padding-left: 38px; }
.xidle-toc-h5 a, .xidle-toc-h6 a { padding-left: 50px; }

/* --------------------------------------------------------------------------
   9. 分页
   -------------------------------------------------------------------------- */
.xidle-pager-wrap {
    margin: 34px 0 48px;
}
.xidle-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.xidle-pager li a,
.xidle-pager li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    transition: all 0.18s ease;
}
.xidle-pager li a:hover { border-color: var(--accent); color: var(--accent); }
.xidle-pager li.is-current > a {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
.xidle-pager li.is-prev a,
.xidle-pager li.is-next a { padding: 0 16px; }

/* --------------------------------------------------------------------------
   10. 文章正文
   -------------------------------------------------------------------------- */
.xidle-post-head { margin-bottom: 26px; }
.xidle-post-title {
    font-family: var(--font-serif);
    font-size: 30px;
    line-height: 1.45;
    color: var(--text);
    margin-bottom: 14px;
}
.xidle-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-faint);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.xidle-post-meta span { display: inline-flex; align-items: center; gap: 5px; }
.xidle-post-meta svg { color: var(--text-faint); }
.xidle-post-meta a { color: var(--text-muted); }

/* 点赞 / 分享 */
.xidle-post-meta .xidle-post-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.xidle-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.5;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
.xidle-action:hover { border-color: var(--accent); color: var(--accent); }
.xidle-post-meta .xidle-action svg { color: currentColor; }
.xidle-like.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.xidle-post-meta .xidle-share { position: relative; display: inline-flex; }
.xidle-post-meta .xidle-share-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 70;
    width: 268px;
    max-width: calc(100vw - 32px);
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.xidle-post-meta .xidle-share-pop[hidden] { display: none; }

/* 分享目标：一行四个 */
.xidle-share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.xidle-share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 2px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.xidle-share-item em { font-style: normal; }
.xidle-share-item svg { color: currentColor; }
.xidle-share-item:hover { background: var(--surface-2); color: var(--accent); }

/* 二维码 */
.xidle-share-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.xidle-share-qr img {
    width: 132px;
    height: 132px;
    padding: 6px;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}
.xidle-share-tip { font-size: 12px; color: var(--text-faint); }

/* 面包屑 */
.xidle-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-faint);
    margin-bottom: 14px;
}
.xidle-breadcrumb a { color: var(--text-muted); }
.xidle-breadcrumb a:hover { color: var(--accent); }
.xidle-breadcrumb-sep { color: var(--border-strong); }

.xidle-post-body {
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--text);
    word-wrap: break-word;
}
.xidle-post-body > *:first-child { margin-top: 0; }
.xidle-post-body p { margin: 0 0 1.15em; }
.xidle-post-body h1, .xidle-post-body h2, .xidle-post-body h3,
.xidle-post-body h4, .xidle-post-body h5, .xidle-post-body h6 {
    margin: 1.6em 0 0.7em;
    line-height: 1.45;
    scroll-margin-top: 80px;
}
.xidle-post-body h2 { font-size: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.xidle-post-body h3 { font-size: 18.5px; }
.xidle-post-body h4 { font-size: 16.5px; }
.xidle-post-body a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.xidle-post-body a:hover { border-bottom-color: var(--accent); }
.xidle-post-body img { border-radius: var(--radius-sm); margin: 1.2em auto; box-shadow: var(--shadow-sm); }
.xidle-post-body ul, .xidle-post-body ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.xidle-post-body ul { list-style: disc; }
.xidle-post-body ol { list-style: decimal; }
.xidle-post-body li { margin: 0.35em 0; }
.xidle-post-body blockquote {
    margin: 1.3em 0;
    padding: 12px 20px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
}
.xidle-post-body blockquote p:last-child { margin-bottom: 0; }
.xidle-post-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--danger);
}
.xidle-post-body pre {
    margin: 1.3em 0;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow-x: auto;
    line-height: 1.6;
}
.xidle-post-body pre code { padding: 0; background: none; color: var(--text); font-size: 13.5px; }
.xidle-post-body table { width: 100%; margin: 1.3em 0; border-collapse: collapse; font-size: 14px; }
.xidle-post-body th, .xidle-post-body td { padding: 9px 13px; border: 1px solid var(--border); text-align: left; }
.xidle-post-body th { background: var(--surface-2); font-weight: 600; }
.xidle-post-body hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

.xidle-post-tags {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.xidle-post-tags-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    color: var(--text-faint);
    font-size: 13px;
    padding-top: 3px;
}
.xidle-post-tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.xidle-post-tags-list a {
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 13px;
}
.xidle-post-tags-list a:hover { background: var(--accent); color: #fff; }

.xidle-copyright {
    margin-top: 24px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 13.5px;
    color: var(--text-muted);
}
.xidle-copyright p { margin: 0 0 6px; }
.xidle-copyright p:last-child { margin-bottom: 0; }
.xidle-copyright strong { color: var(--text); }
.xidle-copyright a { color: var(--accent); word-break: break-all; }

.xidle-post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; }
.xidle-post-nav > div { flex: 1; min-width: 0; }
.xidle-post-nav a {
    display: block;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 14px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.xidle-post-nav a:hover { border-color: var(--accent); color: var(--accent); }
.xidle-post-nav-next { text-align: right; }

/* --------------------------------------------------------------------------
   11. 评论
   -------------------------------------------------------------------------- */
.xidle-comments { margin-top: 44px; }
.xidle-comments-title { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 20px; }
.xidle-comments-title svg { color: var(--accent); }
.xidle-comments-title em {
    font-style: normal;
    font-size: 13px;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    padding: 1px 9px;
}

.xidle-respond { margin-bottom: 30px; }
.xidle-comment-form { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.xidle-form-logged { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--text-muted); }
.xidle-form-logged img { border-radius: 50%; }
.xidle-form-logged a { margin-left: auto; color: var(--accent); font-size: 13px; }
.xidle-form-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.xidle-form-fields input {
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.xidle-form-fields input:focus { border-color: var(--accent); }
.xidle-form-textarea textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.75;
    resize: vertical;
    outline: none;
}
.xidle-form-textarea textarea:focus { border-color: var(--accent); }
.xidle-form-submit { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
/* 「取消回复」按钮：默认隐藏，仅在回复时由 JS 显示，位于「发表评论」左侧 */
.xidle-form-cancel { display: none; }
.xidle-form-cancel a {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 14px;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.xidle-form-cancel a:hover { border-color: var(--accent); color: var(--accent); }

/* 表情选择（自实现） */
.xidle-form-tools { position: relative; margin-right: auto; }
.xidle-emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    transition: border-color 0.18s ease, color 0.18s ease;
}
.xidle-emoji-btn:hover { border-color: var(--accent); color: var(--accent); }
.xidle-emoji-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    width: 316px;
    max-height: 210px;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 70;
}
.xidle-emoji-panel[hidden] { display: none; }
.xidle-emoji-item {
    width: 100%;
    min-width: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 17px;
    line-height: 1;
    overflow: hidden;
    cursor: pointer;
}
.xidle-emoji-item:hover { background: var(--surface-2); }
.xidle-btn-primary {
    padding: 9px 26px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14.5px;
    transition: background-color 0.18s ease;
}
.xidle-btn-primary:hover { background: var(--accent-strong); }

.xidle-comment-list-inner { list-style: none; margin: 0; padding: 0; }
/* 顶部留白给分隔线，底部留白放在「行」上，避免父级内边距与子回复叠加 */
.xidle-comment { padding-top: 14px; border-top: 1px solid var(--border); }
.xidle-comment-list-inner > .xidle-comment:first-child { border-top: none; padding-top: 0; }
.xidle-comment-row { display: flex; gap: 14px; padding-bottom: 14px; }
/* 回复表单被移入评论内时，与上方的回复按钮留出间距 */
.xidle-comment .xidle-respond { margin: 14px 0 0; padding: 0 0 4px; }
.xidle-comment-avatar img { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); }
.xidle-comment-main { flex: 1; min-width: 0; }
.xidle-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.xidle-comment-author { font-weight: 600; color: var(--text); }
.xidle-comment-badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.xidle-comment-content { font-size: 14.5px; color: var(--text-muted); line-height: 1.8; word-wrap: break-word; }
.xidle-comment-content p { margin: 0 0 0.6em; }
.xidle-comment-content p:last-child { margin-bottom: 0; }
.xidle-comment-content img { display: inline-block; }
.xidle-comment-at { color: var(--accent); margin-right: 4px; }
.xidle-comment-waiting { color: var(--text-faint); font-style: normal; }

/* 底部：日期/位置 在左，回复按钮在右 */
.xidle-comment-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-faint);
}
.xidle-comment-meta { display: inline-flex; align-items: center; gap: 4px; }
.xidle-comment-actions { display: inline-flex; align-items: center; }
.xidle-comment-actions a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 12.5px;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.xidle-comment-actions a:hover { border-color: var(--accent); color: var(--accent); }
.xidle-comment-cancel { display: none; }

/* 回复：仅第一层缩进并带一条竖线，更深层与上一级齐平 */
.xidle-comment-list > .xidle-comment-list-inner > .xidle-comment > .xidle-comment-list-inner {
    position: relative;
    margin-top: 0;
    margin-left: 12px;
    padding-left: 20px;
}
.xidle-comment-list > .xidle-comment-list-inner > .xidle-comment > .xidle-comment-list-inner::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.xidle-comment-list-inner .xidle-comment-list-inner .xidle-comment-list-inner {
    margin-top: 0;
    margin-left: 0;
    padding-left: 0;
}
.xidle-comment-empty, .xidle-comment-closed { text-align: center; padding: 40px 0; color: var(--text-faint); font-size: 14px; }

/* --------------------------------------------------------------------------
   12. 时间线 / 阅读记忆 / 归档列表
   -------------------------------------------------------------------------- */
.xidle-timeline { position: relative; margin-top: 10px; padding-left: 26px; border-left: 2px solid var(--border); }
.xidle-timeline-year { position: relative; }
.xidle-timeline-year::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--bg);
}
.xidle-timeline-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.xidle-timeline-year-label { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--accent); }
.xidle-timeline-year-label em { font-style: normal; font-size: 13px; margin-left: 1px; }
.xidle-timeline-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.xidle-timeline-chevron { display: inline-flex; color: var(--text-faint); transition: transform 0.2s ease; }
.xidle-timeline-year.is-collapsed .xidle-timeline-chevron { transform: rotate(-90deg); }
.xidle-timeline-year.is-collapsed .xidle-timeline-list { display: none; }
.xidle-timeline-list { list-style: none; margin: 2px 0 14px; padding: 0; }
.xidle-timeline-item { display: flex; align-items: baseline; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.xidle-timeline-item:last-child { border-bottom: none; }
.xidle-timeline-date { flex-shrink: 0; font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; width: 44px; }
.xidle-timeline-link { flex: 1; min-width: 0; color: var(--text-muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xidle-timeline-link:hover { color: var(--accent); }
.xidle-timeline-cats { flex-shrink: 0; display: inline-flex; gap: 8px; font-size: 12.5px; }
.xidle-timeline-cats a { color: var(--text-faint); }
.xidle-timeline-cats a:hover { color: var(--accent); }

.xidle-reading-year { margin-bottom: 26px; }
.xidle-reading-year-label { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 12px; }
.xidle-reading-year-label em {
    font-style: normal;
    font-size: 12px;
    color: var(--text-faint);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 1px 9px;
}
.xidle-reading-list li { display: flex; gap: 14px; padding: 8px 12px; border-radius: var(--radius-sm); transition: background-color 0.18s ease; }
.xidle-reading-list li:hover { background: var(--surface); }
.xidle-reading-date { flex-shrink: 0; width: 44px; color: var(--text-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.xidle-reading-list a { color: var(--text-muted); }
.xidle-reading-list a:hover { color: var(--accent); }

.xidle-arch-list li { border-bottom: 1px solid var(--border); }
.xidle-arch-list li:last-child { border-bottom: none; }
.xidle-arch-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 2px;
    color: var(--text-muted);
    font-size: 14px;
}
.xidle-arch-list a:hover { color: var(--accent); }
.xidle-arch-count { font-size: 12px; color: var(--text-faint); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; }
.xidle-arch-months { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }

.xidle-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.xidle-links-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.xidle-links-item:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.xidle-links-avatar img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.xidle-links-info { display: flex; flex-direction: column; min-width: 0; }
.xidle-links-info strong { font-size: 14.5px; color: var(--text); }
.xidle-links-info em { font-style: normal; font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xidle-links-tip { color: var(--text-muted); }
.xidle-links-content { margin-top: 24px; }

/* --------------------------------------------------------------------------
   13. 404
   -------------------------------------------------------------------------- */
.xidle-404 { text-align: center; padding: 90px 20px; }
.xidle-404-code { font-family: var(--font-serif); font-size: 88px; font-weight: 700; color: var(--accent); line-height: 1; }
.xidle-404-text { color: var(--text-muted); margin: 18px 0 26px; }
.xidle-404-btn { display: inline-block; padding: 10px 28px; border-radius: 999px; background: var(--accent); color: #fff; }
.xidle-404-btn:hover { background: var(--accent-strong); color: #fff; }

/* --------------------------------------------------------------------------
   14. 返回顶部 & 页脚
   -------------------------------------------------------------------------- */
.xidle-backtop {
    position: fixed;
    right: 26px;
    bottom: 70px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    box-shadow: var(--shadow);
    z-index: 40;
    transition: color 0.18s ease, transform 0.18s ease;
}
.xidle-backtop:hover { color: var(--accent); transform: translateY(-3px); }

.xidle-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: auto;
}
.xidle-footer-inner {
    display: grid;
    grid-template-columns: 1fr minmax(0, var(--content-max)) 1fr;
    align-items: center;
    padding: 18px var(--pad);
    font-size: 13px;
    color: var(--text-faint);
}

/* 登录信息所在左侧区：右对齐到竖线 */
.xidle-footer-zone {
    justify-self: end;
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.xidle-footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 0 var(--pad);
}

.xidle-footer-left { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.xidle-footer-right { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.xidle-footer a { color: var(--text-muted); }
.xidle-footer a:hover { color: var(--accent); }
.xidle-footer-sep { color: var(--border-strong); }

.xidle-footer-ico { display: inline-flex; align-items: center; gap: 4px; }
.xidle-footer-ico svg { color: var(--text-faint); }
.xidle-footer-ico:hover svg { color: var(--accent); }

.xidle-user { position: relative; }
.xidle-user-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.xidle-user-name:hover,
.xidle-user-name[aria-expanded="true"] { color: var(--accent); background: var(--surface-2); }

.xidle-usermenu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    min-width: 138px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    z-index: 60;
}
.xidle-usermenu[hidden] { display: none; }
.xidle-usermenu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 13.5px;
}
.xidle-usermenu a:hover { background: var(--surface-2); color: var(--accent); }

/* --------------------------------------------------------------------------
   15. 响应式
   -------------------------------------------------------------------------- */

/* 中等宽度：收窄内容容器，给页头左侧的 LOGO 留出足够空间 */
@media (max-width: 1440px) and (min-width: 1281px) {
    :root { --content-max: 1000px; }
}

/* 视口不足以容纳左侧浮动图标栏时，收起为抽屉 */
@media (max-width: 1280px) {
    :root { --pad: 26px; }

    /* 左侧图标栏收起为抽屉 */
    .xidle-rail {
        position: fixed;
        left: 0;
        top: 0;
        right: auto;
        bottom: 0;
        width: 76px;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: var(--shadow);
        border-right: 1px solid var(--border);
        background: var(--bg);
        z-index: 60;
    }
    .xidle-rail.is-open { transform: translateX(0); }

    .xidle-rail-inner { padding-top: 24px; }

    .xidle-menu-toggle { display: inline-flex; }
    .xidle-content-row { border-left: none; }

    /* 无左侧栏时，页头 / 页脚恢复为居中单列 */
    .xidle-topnav-inner {
        display: flex;
        gap: 12px;
        max-width: var(--content-max);
        margin: 0 auto;
    }
    .xidle-topnav-left { justify-self: auto; padding-right: 0; }
    .xidle-topnav-main { flex: 1; padding: 0; }

    .xidle-footer-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px 16px;
        max-width: var(--content-max);
        margin: 0 auto;
    }
    .xidle-footer-zone { justify-self: auto; padding-right: 0; }
    .xidle-footer-main { flex: 1; padding: 0; }
}

/* 窄屏：隐藏右侧栏，正文单列 */
@media (max-width: 1024px) {
    .xidle-content-row { flex-direction: column; gap: 20px; padding-bottom: 24px; }
    .xidle-sidebar { display: none; }
}

@media (max-width: 640px) {
    body.xidle-body { font-size: 14.5px; }
    .xidle-content-row { padding: 18px 16px 8px; gap: 20px; }
    .xidle-topnav-inner, .xidle-searchbar form, .xidle-footer-inner { padding-left: 16px; padding-right: 16px; }
    .xidle-brand-text { font-size: 20px; letter-spacing: 1px; }
    .xidle-topnav-list { gap: 0; }
    .xidle-nav-item > a { padding: 7px 10px; }

    .xidle-card { padding: 18px 16px; }
    .xidle-card-head { flex-direction: column; gap: 4px; }
    .xidle-card-title { font-size: 17.5px; }
    .xidle-card-body { flex-direction: column; }
    .xidle-card-thumb { width: 100%; height: 158px; }
    .xidle-card-excerpt { -webkit-line-clamp: 3; }

    .xidle-post-title { font-size: 24px; }
    .xidle-form-fields { grid-template-columns: 1fr; }
    .xidle-arch-months { grid-template-columns: 1fr; }
    .xidle-footer-inner { justify-content: center; text-align: center; }
    .xidle-404-code { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
