/* ============================================ */
/* yicool.com.cn - 社交媒体平台样式              */
/* X.com + 微博风格                             */
/* ============================================ */

/* --- Reset & Base --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
    --bg-primary: #000;
    --bg-secondary: #16181c;
    --bg-hover: #1a1a1a;
    --border-color: #2f3336;
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --accent: #1d9bf0;
    --accent-hover: #1a8cd8;
    --danger: #f4212e;
    --danger-hover: #dc1f2b;
    --success: #00ba7c;
    --like-color: #f91880;
    --repost-color: #00ba7c;
    --repost: #00ba7c;
    --sidebar-width: 275px;
    --right-sidebar-width: 350px;
    --max-content-width: 600px;
    --radius: 16px;
    --radius-sm: 8px;
    --bg-elevated: #15202b;
}

/* 白天模式（Light Mode）变量 —— 覆盖深色默认值 */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f9f9;
    --bg-hover: #eff3f4;
    --border-color: #eff3f4;
    --text-primary: #0f1419;
    --text-secondary: #536471;
    --accent: #1d9bf0;
    --accent-hover: #1a8cd8;
    --danger: #f4212e;
    --danger-hover: #dc1f2b;
    --success: #00ba7c;
    --like-color: #f91880;
    --repost-color: #00ba7c;
    --repost: #00ba7c;
    --bg-elevated: #ffffff;
}

html {
    /* 防止横向意外偏移/漂移：禁止横向滚动与橡皮筋横向拉动 */
    overflow-x: hidden;
    /* 消除移动端双击缩放、300ms 点击延迟造成的界面抖动 */
    touch-action: manipulation;
    /* 滚动到顶/底时不触发浏览器的 overscroll 横向/纵向橡皮筋，避免内容漂移 */
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-y: scroll;
    overflow-x: hidden;
    /* 字号不随系统/浏览器设置意外放大导致布局错位 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* 统一点击高亮为透明，避免移动端点击出现灰色块闪烁 */
    -webkit-tap-highlight-color: transparent;
    /* 全局去除双击缩放抖动 */
    touch-action: manipulation;
}

/* 交互元素统一去除双击缩放，避免界面意外漂移 */
a, button, input, textarea, select, label, [role="button"] {
    touch-action: manipulation;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
input, textarea, button { font: inherit; }

/* --- Layout --- */
.app {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 12px;
    border-right: 1px solid var(--border-color);
    z-index: 10;
}

.sidebar-inner { flex: 1; }

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: background .2s;
}
.logo:hover { background: var(--bg-hover); text-decoration: none; }

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 28px;
    color: var(--text-primary);
    font-size: 19px;
    transition: background .2s;
    margin-bottom: 2px;
    text-decoration: none;
    position: relative;
}
.nav-item:hover { background: var(--bg-hover); text-decoration: none; }
.nav-item.active { font-weight: 700; }
.nav-item[data-active="1"] { font-weight: 700; }

/* 图标容器：用于承载 badge，使其锚定在图标右上角（与文字宽度无关） */
.nav-item .nav-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.nav-item .badge {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0 5px;
    border-radius: 9999px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: absolute;
    top: -6px;
    right: -8px;
    border: 2px solid var(--bg-primary);
    z-index: 2;
}

.post-btn-wrapper { margin-top: 12px; padding: 0; }

/* --- Sidebar User --- */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background .2s;
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
    color: inherit;
}
.sidebar-user-more { flex-shrink: 0; color: var(--text-primary); }
.sidebar-user-more:hover { color: var(--accent); }

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.sidebar-user-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-handle { color: var(--text-secondary); font-size: 13px; }
.sidebar-logout { color: var(--text-secondary); font-size: 20px; font-weight: 700; padding: 4px; border-radius: 50%; }
.sidebar-logout:hover { color: var(--text-primary); }

/* 折叠控制按钮（x.com 风格：将左侧栏收成小图标条） */
.sidebar-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 0 4px 3px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s;
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); }

/* --- 折叠态（仅桌面端生效） --- */
.sidebar.collapsed {
    width: 88px;
    padding-left: 8px;
    padding-right: 8px;
    align-items: center;
}
.sidebar.collapsed .sidebar-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.sidebar.collapsed .logo,
.sidebar.collapsed .sidebar-collapse-btn {
    margin-left: 0;
    margin-right: 0;
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    width: 50px;
    padding: 12px 0;
    gap: 0;
}
.sidebar.collapsed .nav-item > span:not(.nav-icon) { display: none; }
.sidebar.collapsed .post-btn-wrapper { width: 50px; }
.sidebar.collapsed .post-btn-wrapper .btn { padding: 12px; justify-content: center; }
.sidebar.collapsed .post-btn-wrapper .btn span.btn-label { display: none; }
.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
}
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-logout,
.sidebar.collapsed .theme-toggle-sidebar { display: none; }

/* 折叠态：悬停显示功能气泡（对齐 x.com 侧边栏图标 tooltip） */
@media (min-width: 701px) {
    .sidebar.collapsed .nav-item { position: relative; }
    .sidebar.collapsed .nav-item[data-label]:hover::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-elevated, #fff);
        color: var(--text-primary, #0f1419);
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        padding: 10px 14px;
        border-radius: 6px;
        box-shadow: 0 2px 12px rgba(0,0,0,.25);
        z-index: 1000;
        pointer-events: none;
    }
    /* 气泡左侧小箭头 */
    .sidebar.collapsed .nav-item[data-label]:hover::before {
        content: "";
        position: absolute;
        left: calc(100% + 6px);
        top: 50%;
        transform: translateY(-50%);
        border: 6px solid transparent;
        border-right-color: var(--bg-elevated, #fff);
        z-index: 1000;
        pointer-events: none;
    }
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    max-width: var(--max-content-width);
    width: 100%;
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
    min-height: 100dvh;
}

.page-container { width: 100%; padding: 0 16px; box-sizing: border-box; }
.page-container .page-header { margin: 0 -16px 16px; padding-left: 16px; padding-right: 16px; }

.page-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary); /* 回退：不支持 color-mix 的浏览器 */
    background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
}
.page-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-header.no-border { border-bottom: none; }

/* 首页信息流双 Tab：为你推荐 / 正在关注（X.com 风格） */
.page-header.feed-header {
    padding-left: 0;
    padding-right: 0;
}
.feed-tabs {
    display: flex;
    width: 100%;
    margin: 0;
    border-bottom: 1px solid var(--border-color, #eff3f4);
}
.feed-tab {
    flex: 1 1 0;
    appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    height: 53px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary, #536471);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
}
.feed-tab span {
    position: relative;
    padding: 0 8px;
    line-height: 1;
}
.feed-tab:hover { color: var(--text-primary, #0f1419); }
.feed-tab:hover span::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 20px);
    height: 36px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-primary, #0f1419) 8%, transparent);
}
.feed-tab.active { color: var(--text-primary, #0f1419); font-weight: 800; }
.feed-tab.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent, #1d9bf0);
}
.feed-tab-loading { display: flex; justify-content: center; padding: 40px 0; }

/* 列表视图切换组件：默认（桌面端）隐藏，仅移动端首页信息流显示 */
.feed-view-switch {
    display: none;
    align-items: center;
    gap: 2px;
    margin: 8px 10px 4px;
    padding: 2px;
    background: #f0f0f2;
    border-radius: 8px;
    width: fit-content;
    margin-left: auto;
}
.feed-view-switch .fvs-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #8a8a8a;
    width: 34px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.feed-view-switch .fvs-btn.active {
    background: #ffffff;
    color: #ff2442;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* 正在关注：排序方式选择器（热门 / 最近），仿 X.com 顶部右侧下拉 */
.feed-sort {
    position: relative;
    margin-left: auto;
    align-self: center;
}
.feed-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--border-color, #cfd9de);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #0f1419);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.feed-sort-btn:hover { background: color-mix(in srgb, var(--text-primary, #0f1419) 8%, transparent); }
.feed-sort-btn svg { fill: currentColor; }
.feed-sort-label { color: var(--text-secondary, #536471); font-weight: 500; }
.feed-sort-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #eff3f4);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    padding: 6px 0;
    display: none;
    z-index: 50;
}
.feed-sort-menu.open { display: block; }
.feed-sort-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #0f1419);
    cursor: pointer;
}
.feed-sort-item:hover { background: color-mix(in srgb, var(--text-primary, #0f1419) 6%, transparent); }
.feed-sort-item.active { color: var(--accent, #1d9bf0); }
.feed-sort-item.active::after { content: " ✓"; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); }

/* 书签页头部：纵向布局，标题行在上、搜索框全宽在下（X.com 风格） */
.bm-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
.page-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header-titles { min-width: 0; }
.page-header-titles .page-subtitle { margin: 0; }

/* --- 书签搜索框（X.com 风格，与 X 尺寸一致） --- */
.bm-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 0;
    background: var(--bg-secondary, #1f2c3a);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0 16px;
    transition: background .15s, border-color .15s;
}
.bm-search:focus-within {
    background: var(--bg-primary, #15202b);
    border-color: var(--accent, #1d9bf0);
}
.bm-search-icon {
    flex-shrink: 0;
    margin-right: 12px;
    pointer-events: none;
}
.bm-search:focus-within .bm-search-icon { fill: var(--accent, #1d9bf0); }
.bm-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 24px;
    padding: 11px 0;
}
.bm-search-input::placeholder { color: var(--text-secondary); font-size: 15px; }
.bm-search-clear {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 8px;
    border: none;
    border-radius: 999px;
    background: var(--accent, #1d9bf0);
    cursor: pointer;
}
.bm-search-clear svg { fill: #fff; }
.bm-search-clear:hover { filter: brightness(1.1); }

/* --- 历史页双标签栏：书签 / 喜欢（X.com /i/history 风格） --- */
.history-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.history-tab {
    flex: 1 1 0;
    text-align: center;
    padding: 16px 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    border-bottom: 3px solid transparent;
    transition: background .2s, color .2s, border-color .2s;
    text-decoration: none;
}
.history-tab:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.history-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
    font-weight: 700;
}
.history-panel[hidden] { display: none; }

/* 喜欢列表容器：使用独立 class，避免与 .post-list 的「加载更多」提取逻辑冲突 */
.likes-post-list { display: block; }

.back-btn {
    color: var(--text-primary);
    padding: 8px;
    margin: -4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.back-btn:hover { background: var(--bg-hover); text-decoration: none; }

/* --- Quick Compose --- */
.quick-compose {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    /* 出血到容器内边距外，使横杆与左右竖栏边框无缝衔接 */
    margin: 0 -16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background .2s;
}
.quick-compose:hover { background: var(--bg-hover); }
.quick-compose-placeholder {
    color: var(--text-secondary);
    font-size: 19px;
    flex: 1;
}

/* 首页内联发帖框（电脑端直接发帖，仿 x.com；移动端仍用弹窗）。
   compose-modal 由 JS 移入 #home-compose-slot 并加 .inline-home 类。 */
@media (min-width: 701px) {
    .modal.inline-home {
        display: block;
        position: static;
        inset: auto;
        z-index: auto;
        align-items: initial;
        justify-content: initial;
        padding: 12px 16px 4px;
        /* 出血到容器内边距外，与 x.com 首页发帖框一样占满主列整宽（600px） */
        margin: 0 -16px;
        border-bottom: 1px solid var(--border-color);
    }
    .modal.inline-home .modal-overlay,
    .modal.inline-home .modal-header { display: none; }
    .modal.inline-home .modal-content {
        max-width: none;
        max-height: none;
        width: auto;
        padding: 0;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        box-shadow: none;
    }
    .modal.inline-home .compose-body textarea {
        min-height: 80px;
        height: 80px;
    }
    #home-compose-slot .quick-compose { display: none; }
}

/* --- Post Card --- */
.post-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    /* 让卡片的横向分隔线（横杆）出血到页面容器内边距之外，
       与左右两侧的竖栏边框无缝衔接，消除间隙 */
    margin: 0 -16px;
    border-bottom: 1px solid var(--border-color);
    transition: background .2s;
    position: relative;
}
.post-card:hover { background: rgba(255,255,255,.02); }

/* 含"转发了"标记的卡片：顶部留出空间给绝对定位的转发条，避免与头像重叠 */
.post-card:has(.repost-indicator) {
    padding-top: 32px;
}

.post-avatar { flex-shrink: 0; }

.post-body { flex: 1; min-width: 0; }

.repost-indicator {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .15s;
}
.repost-indicator svg { flex-shrink: 0; }
.repost-indicator .repost-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.repost-indicator .repost-handle {
    font-weight: 400;
    color: var(--text-secondary);
}
.repost-indicator:hover { color: var(--accent); }
.repost-indicator:hover .repost-text { text-decoration: underline; }

.post-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2px;
}

.post-user-info {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 14px;
    min-width: 0;
}
.post-display-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.post-display-name:hover { text-decoration: underline; }
.verified-icon { flex-shrink: 0; }
.post-username { color: var(--text-secondary); }
.post-dot { color: var(--text-secondary); }
.post-time { color: var(--text-secondary); font-size: 14px; }
.post-time:hover { text-decoration: underline; }

/* ================================================================
   个人资料概要浮层（仿 X.com hover card）
   ================================================================ */
.profile-preview-card {
    position: fixed;
    z-index: 9999;
    width: 300px;
    max-width: calc(100vw - 16px);
    background: var(--bg-elevated, #fff);
    border: 1px solid var(--border-color, #eff3f4);
    border-radius: 16px;
    box-shadow: 0 0 16px rgba(101, 119, 134, 0.2), 0 0 8px rgba(101, 119, 134, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    font-size: 15px;
    color: var(--text-primary, #0f1419);
}
.profile-preview-card.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.ppc-body { padding: 12px 16px 16px; }
.ppc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ppc-avatar {
    display: block;
    border-radius: 50%;
    border: 4px solid var(--bg-elevated, #fff);
    overflow: hidden;
    width: 64px;
    height: 64px;
    flex: none;
    background: #cfd9de;
}
.ppc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 浮层关注按钮已统一复用全站 .follow-btn 样式（见下方“关注按钮”段），无需单独定制 */

.ppc-name { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 17px; color: inherit; text-decoration: none; line-height: 1.2; }
.ppc-name:hover { text-decoration: underline; }
.ppc-verified { color: #1d9bf0; font-size: 14px; }
.ppc-handle { display: block; color: var(--text-secondary, #536471); font-size: 14px; text-decoration: none; }
.ppc-handle:hover { text-decoration: underline; }
.ppc-bio { margin: 8px 0 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.ppc-meta-row { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 14px; color: var(--text-secondary, #536471); }
.ppc-meta { display: inline-flex; align-items: center; }
.ppc-web { color: #1d9bf0; text-decoration: none; }
.ppc-web:hover { text-decoration: underline; }
.ppc-stats { display: flex; gap: 16px; margin-top: 12px; font-size: 14px; color: var(--text-secondary, #536471); }
.ppc-stats a { color: inherit; text-decoration: none; }
.ppc-stats a:hover { text-decoration: underline; }
.ppc-num { color: var(--text-primary, #0f1419); font-weight: 700; }
.ppc-mutual { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color, #eff3f4); font-size: 13px; color: var(--text-secondary, #536471); }
.ppc-mutual-avatar { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex: none; background: #cfd9de; }
.ppc-mutual-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ppc-mutual-text { line-height: 1.3; }
.ppc-loading, .ppc-error { padding: 24px 8px; text-align: center; color: var(--text-secondary, #536471); font-size: 14px; }

@media (prefers-color-scheme: dark) {
    .profile-preview-card {
        background: #15202b;
        border-color: #38444d;
        box-shadow: 0 0 16px rgba(0, 0, 0, 0.5);
    }
    .ppc-avatar { border-color: #15202b; }
    .ppc-mutual { border-top-color: #38444d; }
}

.post-menu { position: relative; flex-shrink: 0; }
.post-menu-btn { font-size: 16px; }
.post-more-btn { border-radius: 999px; }
.post-more-btn:hover { color: var(--accent) !important; background: var(--accent-faint, rgba(29,155,240,0.1)); }

/* 帖子"更多"操作下拉菜单 */
.menu-dropdown.post-menu-dropdown {
    position: absolute;
    top: 130%;
    right: 0;
    left: auto;
    min-width: 168px;
    background: var(--bg-elevated, #15202b);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 4px;
    z-index: 60;
}
.post-menu-dropdown .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}
.post-menu-dropdown .menu-item:hover { background: var(--bg-secondary); }
.post-menu-dropdown .menu-item svg { color: var(--text-secondary); flex-shrink: 0; }
.post-menu-dropdown .menu-item-danger { color: var(--danger, #f4212e); }
.post-menu-dropdown .menu-item-danger svg { color: var(--danger, #f4212e); }
.post-menu-dropdown .menu-item-danger:hover { background: var(--danger-faint, rgba(244,33,46,0.1)); }

.post-content {
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 8px;
}

.post-link { cursor: pointer; }
.post-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* 长帖截断：默认只显示前 280 字符，文末"显示更多"蓝色链接展开（参考 x.com） */
.post-content-preview[hidden],
.post-content-full[hidden] { display: none; }
.show-more-link {
    color: var(--accent);
    cursor: pointer;
    display: block;
    width: fit-content;
    margin-top: 6px;
    text-decoration: none;
}
.show-more-link:hover { text-decoration: underline; }
.show-more-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* 纯转发（内容为空）不显示空内容块，仅展示"转发了" + 内嵌原帖 */
.post-content.empty-content { display: none; }

.post-content .hashtag { color: var(--accent); }
.post-content .hashtag:hover { text-decoration: underline; }
.post-content .mention { color: var(--accent); }
.post-content .link { color: var(--accent); word-break: break-all; }

/* 长链接悬停显示完整 URL 气泡（对齐 x.com：截断链接悬停展示完整地址），桌面端生效 */
@media (min-width: 701px) {
    .post-content a.link[data-fullurl] { position: relative; }
    .post-content a.link[data-fullurl]:hover::after {
        content: attr(data-fullurl);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 0;
        background: var(--bg-elevated, #fff);
        color: var(--text-primary, #0f1419);
        font-size: 13px;
        font-weight: 700;
        line-height: 1.3;
        white-space: normal;
        max-width: 320px;
        word-break: break-all;
        padding: 8px 11px;
        border-radius: 6px;
        box-shadow: 0 2px 12px rgba(0,0,0,.25);
        z-index: 1000;
        pointer-events: none;
    }
    .post-content a.link[data-fullurl]:hover::before {
        content: "";
        position: absolute;
        bottom: calc(100% + 3px);
        left: 12px;
        border: 5px solid transparent;
        border-top-color: var(--bg-elevated, #fff);
        z-index: 1000;
        pointer-events: none;
    }
}

.post-image {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 8px;
}
.post-image img { width: 100%; border-radius: var(--radius); }

/* --- Post Actions --- */
.post-actions {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 4px 8px 4px 0;
    cursor: pointer;
    border-radius: 28px;
    transition: all .2s;
}
.action-btn:hover { color: var(--accent); background: rgba(29,155,240,.1); }
.action-btn:disabled { opacity: .5; cursor: not-allowed; }
.action-btn:disabled:hover { color: var(--text-secondary); background: none; }

/* 朋友圈视图 ".." 更多按钮与弹出菜单（赞 / 评论）：默认全局隐藏，仅手机端朋友圈视图显示 */
.moments-more-btn,
.moments-action-menu {
    display: none;
}

/* 操作按钮悬停提示气泡（对齐 x.com：悬停显示功能词，桌面端生效，避免触屏误触） */
@media (min-width: 701px) {
    .action-btn { position: relative; }
    .action-btn[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg-elevated, #fff);
        color: var(--text-primary, #0f1419);
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        padding: 8px 11px;
        border-radius: 6px;
        box-shadow: 0 2px 12px rgba(0,0,0,.25);
        z-index: 1000;
        pointer-events: none;
    }
    /* 气泡下方小箭头 */
    .action-btn[data-tooltip]:hover::before {
        content: "";
        position: absolute;
        bottom: calc(100% + 3px);
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: var(--bg-elevated, #fff);
        z-index: 1000;
        pointer-events: none;
    }
}

.like-btn:hover { color: var(--like-color); background: rgba(249,24,128,.1); }
.like-btn.liked { color: var(--like-color); }
.repost-btn:hover { color: var(--repost-color); background: rgba(0,186,124,.1); }
.bookmark-btn:hover { color: var(--accent); background: rgba(29,155,240,.1); }
.bookmark-btn.bookmarked { color: var(--accent); }
.share-btn:hover { color: var(--accent); background: rgba(29,155,240,.1); }

/* --- Post Detail Date (detail page, X.com 风格：日期 + 查看次数) --- */
.post-detail-date {
    padding: 14px 16px;
    /* 出血到容器内边距外，使横杆与左右竖栏边框无缝衔接 */
    margin: 0 -16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

/* 内嵌回复框（X.com 风格，位于统计栏与评论列表之间） */
.post-reply-box {
    display: flex;
    gap: 12px;
    padding: 4px 16px 12px;
    /* 出血到容器内边距外，使横杆与左右竖栏边框无缝衔接 */
    margin: 0 -16px;
    border-bottom: 1px solid var(--border-color);
}
.post-reply-box .avatar-md {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.post-reply-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.post-reply-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.4;
    padding: 12px 0 8px;
    resize: vertical;
    min-height: 28px;
    outline: none;
    font-family: inherit;
}
.post-reply-input::placeholder {
    color: var(--text-secondary);
}
.post-reply-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}
.post-reply-hint {
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-secondary);
    padding: 12px 0 2px;
}
.post-reply-hint a {
    color: var(--accent);
    text-decoration: none;
}
.post-reply-hint a:hover {
    text-decoration: underline;
}
.post-reply-disabled {
    padding: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.post-reply-disabled a {
    color: var(--accent);
}

.post-detail-main {
    /* 详情页顶部返回栏高度（桌面端），用于大图顶到视口最顶时抵消其占位。
       若该返回栏实际高度变化，仅需调整此变量。 */
    --detail-top-offset: 53px;
}
.post-detail-main .post-card {
    /* 与网站主页的帖子卡片保持一致的流式排版：
       头像(左, flex-shrink:0) + 正文(右)，头像/昵称/用户名一栏与首页同款 */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    padding: 16px;
    border-bottom: none;
}
/* 详情页主帖本身不是链接：取消其指针效果（兜底，HTML 层已移除链接语义） */
.post-detail-main > .post-card > .post-body.post-link { cursor: default; }
/* 详情页头像沿用首页默认流式布局（与首页帖子一致，头像在昵称左侧并排） */
.post-detail-main .post-avatar {
    position: static;
    top: auto;
    left: auto;
}
/* 详情页转贴卡片：转发条(绝对定位 top:12px)与头像(绝对定位 top:16px)原本重叠。
   给卡片额外顶部内边距，并将头像与正文整体下移到转发条下方，避免文字压头像。 */
.post-detail-main .post-card:has(.repost-indicator) {
    padding-top: 44px;
}
/* 详情页私密帖：头像与「@用户名·时间」改为与个人页面一致的 flex 并排布局。
   "仅你可见"横条独占顶部一行，头像(回到文档流左侧)与文本行在其下方并排，避免遮挡。 */
.post-detail-main .post-card.is-private {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
/* 正文必须独占整行、完整宽度，避免在 flex-wrap 横向布局下被头像/媒体挤压到不可见
   （手机端窄屏尤其明显，会导致「帖子文本内容看不到」） */
.post-detail-main .post-card.is-private .post-content {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
}
.post-detail-main .post-card.is-private .private-badge {
    flex-basis: 100%;
}
.post-detail-main .post-card.is-private .post-avatar {
    position: static;
    top: auto;
    left: auto;
}
.post-detail-main .post-card.is-private .post-header {
    display: flex;
    padding-left: 0;
    padding-top: 0;
}
/* 私帖媒体左缘对齐头像左缘：卡片为 flex 布局，媒体在右侧 body 内，
   需向左出血「头像宽(48px)+间距(10px)=58px」回到头像左侧 */
@media (min-width: 701px) {
    .post-detail-main .post-card.is-private .post-media-gallery,
    .post-detail-main .post-card.is-private .post-image {
        margin-left: -58px !important;
        width: calc(100% + 58px) !important;
    }
}
/* ============================================================
   桌面端详情页：大图顶到视口最顶（X.com / 微博 大图详情）
   仅作用于普通帖(:not(.is-private))，私帖保留原有布局。
   媒体满屏出血到视口顶+左右，日期/头像/正文/操作栏依次排在图片下方。
   ============================================================ */
@media (min-width: 701px) {
    /* 桌面端详情主帖：头像/昵称/用户名一栏与首页帖子保持完全一致的并排流式排版
       （头像在左、昵称与用户名在右，与首页同款），仅正文/媒体字号略放大。 */
    .post-detail-main .post-card:not(.is-private) .post-header {
        padding-left: 0;
        min-height: 0;
    }
    /* 正文与媒体稍作间距，保持阅读舒适；头像已与昵称并排，不再单独占位。
       正文顶部与 post-header 拉开呼吸感（12px 偏挤，桌面端提升至 20px） */
    .post-detail-main .post-card:not(.is-private) .post-content {
        margin-top: 20px;
    }
    /* 宽版正文：正文左缘出血到头像最左侧（头像48px + 间距10px = 58px），
       与私帖媒体的「出血」风格一致。仅桌面端生效、仅普通帖；
       直接子级选择器确保引用帖/评论卡片内的正文不受影响。 */
    .post-detail-main .post-card:not(.is-private) > .post-body > .post-content {
        margin-left: -58px !important;
        width: calc(100% + 58px) !important;
    }
    /* 宽版媒体：图片/视频左缘同样出血到头像最左侧（58px），与正文/头像对齐；
       仅主帖直接子级生效，引用帖/评论内的媒体保持卡片内布局 */
    .post-detail-main .post-card:not(.is-private) > .post-body > .post-media-gallery,
    .post-detail-main .post-card:not(.is-private) > .post-body > .post-image {
        margin-left: -58px !important;
        margin-right: 0 !important;
        width: calc(100% + 58px) !important;
    }
    /* 引用帖内的媒体保持卡片内缩进布局（不随主帖放大） */
    .post-detail-main .quoted-post .post-media-gallery,
    .post-detail-main .quoted-post .post-image {
        order: 0 !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        border-radius: var(--radius) !important;
    }
}
/* 手机端私帖：图片/视频满屏出血到屏幕左(0间距)。
   媒体在 flex body 内被头像(38)+间距(8)+卡片左 padding(16) 右移 62px，
   故向左出血 62px + 100vw 拉到屏幕左缘 */
@media (max-width: 700px) {
    /* 手机端私密帖：保持横向 flex 并排 —— 头像与昵称/用户名在同一行。
       「仅你可见」横条(.private-badge)与正文(.post-content)由基类
       flex-basis:100% 各自独占一行，因此 row+wrap 不会挤压正文，也无需纵向排列。 */
    .post-detail-main .post-card.is-private {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
    }
    /* 正文基础宽度设为 0（flex:1 1 0）：
       基类 flex:1 1 auto 的基础宽度按内容计算（媒体 width:100vw 使正文内容≈视口宽），
       在 wrap 容器中放不下头像右侧剩余空间而触发整行换行，导致头像与昵称/用户名分行。
       改为 flex-basis:0 后正文始终贴着头像同行、按剩余空间伸缩，媒体仍可 100vw 出血。 */
    .post-detail-main .post-card.is-private > .post-body {
        flex: 1 1 0;
        min-width: 0;
    }
    .post-detail-main .post-card.is-private .post-media-gallery,
    .post-detail-main .post-card.is-private .post-image {
        /* 私帖媒体在 flex body 内：用 100% 填充满 body 宽度（body 已是卡片满宽），
           不再用 100vw + -62px 的固定负偏移——该偏移基于时间线卡片的缩进(头像40+间距10+内边距12)，
           在详情页(卡片内边距16、头像绝对定位)会过度左移把图片推出屏幕导致被遮挡。 */
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100%;
    }
}
/* 手机端普通帖媒体：左缘贴屏幕左缘由上方 @media(max-width:700px) 的
   calc(50% - 50vw) 全宽方案自适应实现（详情页主帖为 block 布局+头像绝对定位），
   勿再叠加时间线卡片的固定 -62px 偏移，否则会把媒体推出屏幕导致消失。 */
.post-detail-main .avatar-md {
    width: 48px;
    height: 48px;
}
.post-detail-main .post-display-name {
    font-size: 19px;
}
.post-detail-main .post-username,
.post-detail-main .post-dot {
    font-size: 15px;
}
/* 名字行与首页一致：头像已回到昵称左侧并排，无需给头像让位的左内边距 */
.post-detail-main .post-header {
    padding-left: 0;
    min-height: 0;
}
.post-detail-main .post-content {
    /* 与 x.com 详情页正文一致的字体栈，字号按站点风格定为 17px */
    font-family: "TwitterChirp", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.5;
    margin: 20px 0 16px;
    text-align: left;
}
.post-detail-main .post-media-gallery,
.post-detail-main .post-image {
    margin-left: 0;
    margin-right: 0;
}
.post-detail-actions {
    max-width: 100%;
    /* 出血到容器内边距外，使横杆与左右竖栏边框无缝衔接 */
    margin: 0 -16px;
    border-bottom: 1px solid var(--border-color);
}
.post-detail-actions .post-actions {
    max-width: 100%;
    margin: 0;
    padding: 4px 16px 4px;
}
.comments-section-detail {
    /* 出血到容器内边距外，使顶部横杆与左右竖栏边框无缝衔接 */
    margin: 4px -16px 0;
    border-top: 1px solid var(--border-color);
}
.comments-title {
    font-size: 18px;
    font-weight: 800;
    padding: 14px 16px 6px;
    margin: 0;
    color: var(--text-primary);
}
.comments-section-detail .post-card,
.comments-section-detail .post-content {
    font-size: 15px;
}
/* 评论卡片位于已出血的评论区内，需取消自身出血，避免与父容器叠加错位 */
.comments-section-detail .post-card {
    margin: 0;
}
.comments-section-detail .post-content {
    margin: 8px 0;
}

/* --- 评论卡片（is-comment）精简排版，去除主帖冗余元素 --- */
.post-card.is-comment {
    padding: 12px 16px;
}
.post-card.is-comment .avatar-md {
    width: 40px;
    height: 40px;
}
.post-card.is-comment .post-display-name {
    font-size: 15px;
}
.post-card.is-comment .post-username,
.post-card.is-comment .post-dot {
    font-size: 14px;
}
.post-card.is-comment .post-content {
    font-size: 15px;
    margin: 6px 0 8px;
}
/* 回帖（评论）同样展示书签，与 X.com 回帖工具栏一致（回复/转发/点赞/书签）；
   保留隐藏 share-btn（回帖操作栏未提供该按钮） */
.post-card.is-comment .share-btn {
    display: none;
}
.post-card.is-comment .comments-section {
    margin: 0 -16px -12px;
    border-top: 1px solid var(--border-color);
}


/* --- Comments --- */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 8px;
}

.comment-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.comment-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 8px 0;
    resize: none;
    outline: none;
    min-height: 36px;
}
.comment-input::placeholder { color: var(--text-secondary); }

/* 富文本回复框：支持图片/表情，类发帖布局 */
.comment-form-rich { flex-wrap: wrap; }
.comment-form-rich .comment-compose {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.comment-form-rich .comment-input { width: 100%; }
.comment-form-rich .comment-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.comment-form-rich .comment-bar .compose-tools { margin: 0; }
.comment-form-rich .reply-media-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.comments-list .post-card {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}
.comments-list .post-card:last-child { border-bottom: none; }

/* --- Auth Pages --- */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
}
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-header h1 { font-size: 24px; margin-top: 12px; }

.auth-form .form-group { margin-bottom: 16px; }
.auth-form label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="url"] {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color .2s;
}
.auth-form input:focus {
    border-color: var(--accent);
    outline: none;
}

/* --- 密码显示/隐藏开关 --- */
.password-field {
    position: relative;
}
.auth-form .password-field input,
.settings-form .password-field input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
}
.password-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-secondary, rgba(0, 0, 0, .05));
}
.password-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.password-toggle svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: var(--text-primary) !important;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: auto; accent-color: var(--accent); }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}
.auth-footer a { color: var(--accent); }
/* 按钮内的文字（如 .btn-primary 白字）需优先于 .auth-footer a 的颜色，避免蓝字蓝底被遮挡 */
.auth-footer a.btn { color: #fff; }
.auth-footer a.btn-outline { color: var(--text-primary); }
.auth-closed {
    background: rgba(217,72,79,.08);
    border: 1px solid rgba(217,72,79,.25);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 6px 0 4px;
}
.auth-closed p { margin: 0 0 6px; }
.auth-closed p:last-child { margin-bottom: 0; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: none;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
    background: var(--bg-elevated, var(--bg-primary));
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-hover, var(--bg-secondary)); }
.btn-dark { background: #0f1419; color: #fff; }
.btn-dark:hover { background: #272c30; }
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-secondary);
}
.btn-outline:hover { border-color: var(--danger); color: var(--danger); background: rgba(244,33,46,.1); }
.btn-sm { padding: 4px 14px; font-size: 14px; }
.btn-block { width: 100%; padding: 12px 20px; }

/* --- 关注按钮（全站统一，仿 X.com） ---
   .btn-follow / .follow-btn 为基础类（未关注态：蓝底白字）
   .following / .btn-outline 为已关注态（透明底、灰边框、深色字）
   已关注 hover 时变红并显示"取消关注" */
.btn-follow,
.follow-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    color: #fff;
    background: var(--accent, #1d9bf0);
    transition: background-color .2s, color .2s, border-color .2s;
}
.btn-follow:hover,
.follow-btn:hover {
    background: var(--accent-hover, #1a8cd8);
    color: #fff;
    text-decoration: none;
}
.btn-follow.following,
.follow-btn.btn-outline,
.btn-follow[aria-pressed="true"],
.follow-btn[aria-pressed="true"] {
    background: transparent;
    color: var(--text-primary, #0f1419);
    border-color: var(--text-secondary, #536471);
}
.btn-follow.following:hover,
.follow-btn.btn-outline:hover,
.btn-follow[aria-pressed="true"]:hover,
.follow-btn[aria-pressed="true"]:hover {
    color: transparent;
    border-color: var(--danger, #f4212e);
    background: rgba(244, 33, 46, .1);
}
/* hover 时原文字透明，叠加显示"取消关注" */
.btn-follow.following:hover::after,
.follow-btn.btn-outline:hover::after,
.btn-follow[aria-pressed="true"]:hover::after,
.follow-btn[aria-pressed="true"]:hover::after {
    content: '取消关注';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--danger, #f4212e);
    pointer-events: none;
}
.btn-follow:disabled,
.follow-btn:disabled { opacity: .6; cursor: default; }
.btn-follow.btn-sm,
.follow-btn.btn-sm { padding: 4px 16px; font-size: 14px; }
.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    transition: all .2s;
}
.btn-icon:hover { color: var(--accent); background: rgba(29,155,240,.1); }

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 0 auto 16px;
    max-width: var(--max-content-width);
    font-size: 14px;
}
.alert-error { background: rgba(244,33,46,.1); border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: rgba(0,186,124,.1); border: 1px solid var(--success); color: var(--success); }

/* --- Avatars --- */
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 135px; height: 135px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg-primary); }
.avatar-xl { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }

/* --- Profile --- */
.profile-header-img {
    height: 200px;
    position: relative;
    background-size: cover;
    background-position: center;
}
.profile-header-img.has-img { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
/* 编辑/添加封面：铺满整块 banner 的悬停遮罩（X.com 风格） */
.profile-header-edit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease;
    z-index: 2;
}
.profile-header-edit svg { width: 22px; height: 22px; }
/* 已有封面：仅 hover 时显示半透明遮罩 */
.profile-header-img.has-img:hover .profile-header-edit {
    opacity: 1;
    background: rgba(0, 0, 0, 0.4);
}
.profile-header-edit:hover { background: rgba(0, 0, 0, 0.55); }
/* 无封面：常显，引导用户添加照片 */
.profile-header-img:not(.has-img) .profile-header-edit {
    opacity: 1;
    background: rgba(0, 0, 0, 0.28);
}
.profile-header-edit:disabled { opacity: 1; cursor: default; }
/* 移除封面：右下角小按钮，hover 时显示（仅已有封面） */
.profile-header-remove {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 3;
    opacity: 0;
    transition: background .15s ease, opacity .15s ease;
}
.profile-header-img.has-img:hover .profile-header-remove { opacity: 1; }
.profile-header-remove:hover { background: rgba(180, 0, 0, 0.8); }
.profile-header-input,
.hidden { display: none; }
/* X.com 风格：你关注了对方、但对方未关注你、且你关注的人中无人关注时的提示条 */
.profile-follow-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary, #71767b);
    border-bottom: 1px solid var(--border, #2f3336);
}
.profile-follow-note svg { flex: 0 0 auto; }
.profile-follow-note a { color: var(--accent, #1d9bf0); text-decoration: none; }
.profile-follow-note a:hover { text-decoration: underline; }
/* X.com 风格：共同关注提示条（赛琳Celine、Mathematica 和你关注的另外 N 人关注了此账号），位于关注数统计行下方 */
.profile-mutual-follows {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary, #71767b);
}
.mutual-avatars { display: flex; flex: 0 0 auto; }
.mutual-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--bg, #000);
    margin-left: -8px;
}
.mutual-avatar:first-child { margin-left: 0; }
.mutual-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mutual-text a { color: inherit; text-decoration: none; }
.mutual-text a:hover { text-decoration: underline; }
.mutual-text { line-height: 1.4; }
/* X.com：banner 高 200px，头像(135px)上移约 2/3 使其底部悬于 banner 下方，
   编辑资料按钮与 banner 之间留出与页面内边距一致的间距，不再紧贴封面 */
.profile-info { padding: 12px 16px 12px; position: relative; }
.profile-avatar-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: -67px;
    margin-bottom: 12px;
}
.profile-actions {
    margin-top: 67px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.profile-details { margin-top: 4px; }

.profile-details {}
.profile-name-row { display: flex; align-items: center; gap: 4px; }
.profile-display-name { font-size: 20px; font-weight: 800; }
.profile-username { color: var(--text-secondary); font-size: 15px; margin-bottom: 8px; }
.profile-bio { font-size: 15px; margin-bottom: 12px; white-space: pre-wrap; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; color: var(--text-secondary); font-size: 14px; }
.profile-meta span { display: flex; align-items: center; gap: 4px; }
.profile-meta a { color: var(--accent); }

.profile-stats { display: flex; gap: 16px; font-size: 14px; margin-bottom: 4px; }
.profile-stats .stat { color: var(--text-secondary); display: flex; gap: 4px; }
.profile-stats .stat strong { color: var(--text-primary); }
.profile-stats .stat:hover { text-decoration: underline; }

/* 个人资料页 - 绑定手机号 */
.profile-phone-box {
    margin: 12px 0 4px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-elevated, var(--bg-primary));
}
.profile-phone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.profile-phone-label { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.profile-phone-status { font-size: 13px; color: var(--text-secondary); }
.profile-phone-form { margin: 0; }
.profile-phone-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-phone-input {
    flex: 1 1 200px;
    min-width: 160px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}
.profile-phone-input:focus { border-color: var(--accent); }
.profile-phone-save { height: 38px; }
.profile-phone-unbind { height: 38px; }
.profile-phone-form .field-error { display: block; color: #f4212e; font-size: 12px; margin-top: 6px; }

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.profile-tabs .tab {
    flex: 1;
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: all .2s;
    border-bottom: 3px solid transparent;
}
.profile-tabs .tab:hover { background: var(--bg-hover); text-decoration: none; color: var(--text-primary); }
.profile-tabs .tab.active { color: var(--text-primary); border-bottom-color: var(--accent); font-weight: 700; }
.profile-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.profile-tabs .tab { white-space: nowrap; flex: 0 0 auto; padding: 14px 16px; min-width: 64px; }

/* --- 个人主页帖子搜索栏 --- */
.profile-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 20;
}
.profile-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-input, #fff);
    transition: border-color .15s, box-shadow .15s;
}
.profile-search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.psf-icon { flex-shrink: 0; }
.psf-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary);
}
.psf-input::placeholder { color: var(--text-secondary); }
.psf-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.psf-clear:hover { opacity: .85; }
.psf-reset {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}
.psf-reset:hover { text-decoration: underline; }
.profile-search-status {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
}
/* 搜索结果排序：时间 / 热门 */
.psf-sort {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-input, #fff);
}
.psf-sort-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.psf-sort-btn + .psf-sort-btn { border-left: 1px solid var(--border-color); }
.psf-sort-btn:hover { color: var(--text-primary); }
.psf-sort-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
/* 关键词高亮 */
mark.search-hl {
    background: #ffe58a;
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
    font-weight: 600;
}

/* --- 用户列表（正在关注 / 关注者，X.com 风格） --- */
.user-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.user-row:hover { background: var(--bg-hover); }
.user-row-avatar { flex: 0 0 auto; }
.user-row-avatar img {
    width: 48px; height: 48px; border-radius: 50%;
    object-fit: cover; background: var(--bg-secondary);
}
.user-row-info { flex: 1 1 auto; min-width: 0; color: var(--text-primary); text-decoration: none; }
.user-row-info:hover { text-decoration: none; }
.user-row-name {
    font-weight: 700; display: flex; align-items: center; gap: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-row-handle { color: var(--text-secondary); font-size: 14px; }
.user-row-bio {
    color: var(--text-secondary); font-size: 14px; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.user-row-action { flex: 0 0 auto; align-self: center; }
.user-row-you {
    font-size: 13px; color: var(--text-secondary);
    border: 1px solid var(--border-color); border-radius: 999px;
    padding: 4px 12px; display: inline-block;
}
.user-row .follow-btn { min-width: 76px; }

/* --- 你认识的关注者列表页（followers_you_follow） --- */
.profile-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg, #fff);
    z-index: 10;
}
.profile-section-header .back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-primary);
    transition: background .2s;
}
.profile-section-header .back-link:hover { background: var(--bg-hover); }
.profile-section-title h1 { font-size: 20px; font-weight: 800; margin: 0; line-height: 1.2; }
.profile-section-sub { font-size: 13px; color: var(--text-secondary); }

.followers-you-follow-desc {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 12px 16px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}
.followers-you-follow-desc a { color: var(--accent, #1d9bf0); text-decoration: none; }
.followers-you-follow-desc a:hover { text-decoration: underline; }

/* 关注相关页面的四标签栏（仿 X.com） */
.follow-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg, #fff);
    z-index: 9;
}
.follow-tabs .follow-tab {
    flex: 1 1 0;
    text-align: center;
    padding: 16px 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    transition: background .15s;
}
.follow-tabs .follow-tab:hover { background: var(--bg-hover); }
.follow-tabs .follow-tab span {
    display: inline-block;
    padding: 0 4px;
    position: relative;
}
.follow-tabs .follow-tab.active { color: var(--text-primary); font-weight: 800; }
.follow-tabs .follow-tab.active span::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: -16px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent, #1d9bf0);
}
@media (max-width: 600px) {
    .follow-tabs .follow-tab { font-size: 13px; padding: 14px 2px; }
}

/* 用户行内的名称/句柄链接去下划线 */
.user-row-info a { color: var(--text-primary); text-decoration: none; }
.user-row-info a:hover { text-decoration: underline; }
.user-row-name { color: var(--text-primary); }
.user-row .btn-follow {
    flex: 0 0 auto;
    align-self: center;
    min-width: 80px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.pagination-info { font-size: 14px; color: var(--text-secondary); }

/* --- 媒体网格（X.com 风格） --- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px 0;
}
.media-grid-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-secondary);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
/* 让点击穿透到 <a> 本身，由浏览器原生处理 href 导航（不依赖 JS） */
.media-grid-item img,
.media-grid-item video {
    pointer-events: none;
}
.media-thumb {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform .25s, filter .2s;
}
.media-grid-item:hover .media-thumb {
    filter: brightness(.85);
}
.media-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding-left: 4px;
    box-sizing: border-box;
}
.media-count {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}
@media (max-width: 700px) {
    .media-grid { gap: 2px; }
    /* 手机端：帖子内图片/视频满屏显示，左右边框与屏幕左右边框对齐。
       抵消“容器左内边距(12) + 头像(40) + 间距(10)”共 62px 的缩进，宽度拉满视口。 */
    .post-card .post-media-gallery {
        width: 100vw;
        margin-left: -62px;
        margin-right: 0;
    }
    /* 引用帖内的嵌套画廊保持内嵌缩进，不参与满屏出血 */
    .quoted-post .post-media-gallery,
    .quoted-post .post-media-gallery.gallery-slider {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    /* 详情页（/post/xxx）主帖媒体：移动端在卡片内自适应铺满，杜绝 100vw + 负 margin 方案
       在「卡片内边距 ≠ 62px / 卡片未贴视口边缘」时把图片、视频推出屏幕导致被遮挡或横向溢出。
       采用「容器内 100% 宽度、零外边距」的稳妥方案，保证媒体永远完整、不越界。 */
    .post-detail-main .post-card .post-media-gallery,
    .post-detail-main .post-card .post-media-gallery.gallery-slider,
    .post-detail-main .post-card .post-image {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        /* 移动端不采用桌面「大图顶到视口最顶」(order:-1 + 负 margin-top) 风格，
           否则图片会被顶到用户栏之上并挤出首屏，导致正文不可见。
           此处图片保持正常文档流（用户栏→正文→图片），确保正文首屏可见。 */
        border-radius: var(--radius);
        overflow: hidden;
    }
    /* 媒体元素本身：宽度受限、等比缩放，绝不溢出屏幕 */
    .post-detail-main .post-card .post-media-gallery img,
    .post-detail-main .post-card .post-media-gallery video,
    .post-detail-main .post-card .post-image img,
    .post-detail-main .post-card .post-image video {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
    }
    /* 单图/单视频：移动端按原始比例铺满卡片宽，去掉桌面端的 510px 上限与 contain 留白 */
    .post-detail-main .post-card .gallery-1 .gallery-item,
    .post-detail-main .post-card .post-image:not(:has(.gallery-item)) {
        max-height: none;
        aspect-ratio: auto;
        background: var(--bg-elevated);
        overflow: hidden;
    }
    .post-detail-main .post-card .gallery-1 .gallery-img,
    .post-detail-main .post-card .gallery-1 .gallery-media,
    .post-detail-main .post-card .post-image:not(:has(.gallery-item)) img,
    .post-detail-main .post-card .post-image:not(:has(.gallery-item)) video {
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: none;
        object-fit: contain;
    }
}

/* ============================================================
   手机端首页：小红书风格 2 列瀑布流卡片视图（默认启用）
   仅在 ≤700px 生效；桌面端保持 X.com 单列时间线不变
   ============================================================ */
@media (max-width: 700px) {
    /* 移动端首页：显示列表视图切换组件（小红书 / 朋友圈） */
    .feed-view-switch { display: flex; }

    /* 手机端首页：小红书风格配色与字体变量（仅作用于 ≤700px 首页卡片区域）
       采用小红书暖浅色体系，与 X.com 蓝黑深色主题解耦，文字/配色更协调 */
    :root {
        --xhs-bg: #f7f7f8;          /* 页面浅灰底 */
        --xhs-card: #ffffff;        /* 卡片纯白 */
        --xhs-border: #f0f0f2;      /* 卡片极浅描边 */
        --xhs-text: #333333;        /* 主文字：深灰不刺眼 */
        --xhs-text-sub: #999999;    /* 次要文字：柔和灰 */
        --xhs-accent: #ff2442;      /* 小红书品牌红 */
        /* 圆润中文字体栈，贴近小红书 App 观感 */
        --xhs-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
    /* 首页帖子列表改为 2 列瀑布流（仅小红书视图 .xhs）
       小红书风格：列表左右各留 4px、卡片间距 4px，封面图/视频与卡片边框零间距 */
    #post-list[data-view="xhs"] {
        column-count: 2;
        column-gap: 4px;
        padding: 4px;
        border: none;
        background: var(--xhs-bg);
    }
    /* 每张卡片作为独立瀑布流单元，避免被分栏截断 */
    #post-list > .post-card {
        display: block;            /* 取消 X.com 的 flex 并排布局 */
        width: 100%;
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        margin: 0 0 4px;
        padding: 0;
        background: var(--xhs-card);
        border: 1px solid var(--xhs-border);
        border-radius: 8px;
        overflow: hidden;
        font-family: var(--xhs-font);
        box-shadow: 0 1px 3px rgba(0,0,0,.04);
    }
    /* 隐藏 X.com 时间线的冗余信息（头像行/操作栏/菜单/评论/转发嵌套等）——仅小红书视图。
       注：手机端列表页不展示帖子菜单（仅详情页保留，见下方 .post-menu 全局规则） */
    #post-list[data-view="xhs"] > .post-card > .post-avatar,
    #post-list[data-view="xhs"] > .post-card > .post-body > .post-header,
    #post-list[data-view="xhs"] > .post-card > .post-body > .post-content ~ .post-actions,
    #post-list[data-view="xhs"] > .post-card .post-actions,
    #post-list[data-view="xhs"] > .post-card .comments-section,
    #post-list[data-view="xhs"] > .post-card .quoted-post,
    #post-list[data-view="xhs"] > .post-card .pinned-badge,
    #post-list[data-view="xhs"] > .post-card .private-badge,
    #post-list[data-view="xhs"] > .post-card .reply-restriction-badge,
    #post-list[data-view="xhs"] > .post-card .repost-indicator,
    #post-list[data-view="xhs"] > .post-card .post-location {
        display: none !important;
    }
    /* 重置手机端「图片满屏出血」规则，让封面回到卡片内、与卡片边框零间距（小红书风格） */
    #post-list > .post-card .post-media-gallery,
    #post-list > .post-card .post-image {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border: none;
        border-radius: 0;
        margin-top: 0;
        overflow: hidden;
    }
    /* 视频封面/动图在卡片内统一裁切贴边 */
    #post-list > .post-card .post-media-gallery .gallery-media,
    #post-list > .post-card .post-media-gallery .gallery-img,
    #post-list > .post-card .post-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        border-radius: 0;
        display: block;
    }
    /* 封面图统一按比例裁切，形成错落瀑布流；单图方图，多图网格同样方图裁切 */
    #post-list > .post-card .gallery-item {
        max-height: none;
        aspect-ratio: 1 / 1;
    }
    #post-list > .post-card .gallery-img,
    #post-list > .post-card .gallery-media {
        object-fit: cover;
    }
    /* 标题：最多 2 行省略，小红书卡片式 */
    #post-list > .post-card .post-content {
        font-size: 14px;
        font-weight: 500;
        line-height: 1.45;
        color: var(--xhs-text);
        padding: 8px 10px 4px;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-word;
        letter-spacing: .1px;
    }
    /* 小红书视图：仅取消"显示更多"链接，保留原有的 2 行省略（不展开完整原文） */
    #post-list[data-view="xhs"] > .post-card .show-more-link { display: none !important; }
    /* 小红书式卡片：图片/视频置顶，文本在图片下方、作者页脚最底部。
       重排 .post-body 内部顺序（不影响桌面端 X.com 布局）——仅小红书视图 */
    #post-list[data-view="xhs"] > .post-card > .post-body {
        display: flex;
        flex-direction: column;
    }
    #post-list[data-view="xhs"] > .post-card .post-media-gallery,
    #post-list[data-view="xhs"] > .post-card .post-media-gallery.gallery-slider,
    #post-list[data-view="xhs"] > .post-card .post-image,
    #post-list[data-view="xhs"] > .post-card .post-image video {
        order: -1;            /* 封面图/幻灯片/视频在最上方 */
        flex-shrink: 0;
    }
    #post-list[data-view="xhs"] > .post-card .post-content {
        order: 0;             /* 文本在图片下方 */
    }
    #post-list[data-view="xhs"] > .post-card .post-card-foot-m {
        order: 1;             /* 作者 + 点赞在最底部 */
    }
    /* 无图纯文字帖：给一点最小高度，避免卡片过扁 */
    #post-list > .post-card:not(:has(.post-media-gallery)):not(:has(.post-image)) .post-content {
        min-height: 64px;
    }
    /* 手机端卡片页脚（作者 + 点赞）——仅小红书视图 */
    #post-list[data-view="xhs"] > .post-card .post-card-foot-m {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px 10px;
    }
    #post-list > .post-card .pcfm-avatar {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
    }
    #post-list > .post-card .pcfm-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    #post-list > .post-card .pcfm-name {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 12px;
        font-weight: 400;
        color: var(--xhs-text-sub);
        font-family: var(--xhs-font);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-decoration: none;
    }
    #post-list > .post-like-num,
    #post-list > .post-card .pcfm-like {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        font-size: 12px;
        font-weight: 500;
        color: var(--xhs-text-sub);
        flex-shrink: 0;
        font-family: var(--xhs-font);
    }
    #post-list > .post-card .pcfm-like svg { color: var(--xhs-accent); }

    /* ============================================================
       朋友圈风格视图（.moments）：单列信息流，复刻微信朋友圈
       - 顶部：作者小头像 + 昵称 + 时间（左对齐）
       - 正文：自然段落
       - 图片：单图按原始比例 contain 居中；多图 3 列网格（正方形裁切）
       - 右下角：点赞 / 评论气泡操作面板（朋友圈特有交互）
       ============================================================ */
    #post-list[data-view="moments"] {
        column-count: 1;
        padding: 0;                          /* 改：原 8px 8px 24px → 0，让首张卡片紧贴列表上沿，与列表无缝衔接 */
        background: transparent;             /* 改：原 #ededed → 透明，与页面底色融为一体，去掉"灰底框" */
        border: none;
    }
    #post-list[data-view="moments"] > .post-card {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;                  /* 强制头像与正文同行：基类 flex-wrap:wrap 会让 38+gap+正文(=card 内容区) 换行 */
        break-inside: avoid;
        margin: 0;                          /* 改：原 0 0 10px → 0，卡片之间无空隙 */
        padding: 12px 12px 6px;
        background: var(--bg-primary);      /* 改：原 #ffffff → 主题色，跟随浅/深色模式与页面底色一致，实现真正无缝 */
        border: none;
        border-top: 1px solid var(--border-color);   /* 新增：替代原圆角/阴影作为卡片分隔线（首张卡片的顶部分隔上方切换栏） */
        border-radius: 0;                   /* 改：原 6px → 0，去掉圆角使卡片边缘与列表齐平 */
        overflow: hidden;
        font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
        box-shadow: none;                   /* 改：原 0 1px 2px rgba(0,0,0,.06) → none，去掉阴影使卡片不再"悬浮" */
    }
    /* 朋友圈：左侧小头像（微信风格 4px 圆角方形），右侧内容流 */
    #post-list[data-view="moments"] > .post-card > .post-avatar {
        display: block !important;
        width: 38px;
        flex: 0 0 38px;
        margin: 0;
    }
    #post-list[data-view="moments"] > .post-card > .post-avatar .avatar-md {
        width: 38px;
        height: 38px;
        border-radius: 4px;
    }
    #post-list[data-view="moments"] > .post-card > .post-body {
        flex: 1 1 auto;
        min-width: 0;
        display: block;
    }
    #post-list[data-view="moments"] > .post-card .post-card-foot-m { display: none !important; }
    /* 评论区默认收起（内联 display:none 兜底）；点击 ".." 菜单的"评论"时由
       showComments() 以内联 display:block 展开。不加 !important，否则无法覆盖。 */
    #post-list[data-view="moments"] > .post-card .comments-section { display: none; }
    #post-list[data-view="moments"] > .post-card .quoted-post { display: none !important; }
    #post-list[data-view="moments"] > .post-card .pinned-badge,
    #post-list[data-view="moments"] > .post-card .private-badge,
    #post-list[data-view="moments"] > .post-card .reply-restriction-badge,
    #post-list[data-view="moments"] > .post-card .repost-indicator,
    #post-list[data-view="moments"] > .post-card .post-location { display: none !important; }

    /* 顶部作者行：头像(左) + 昵称/@用户名/时间(右，同一行)，与帖子详情页保持一致 */
    #post-list[data-view="moments"] > .post-card > .post-body > .post-header {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 0 0 4px;
        flex-wrap: nowrap;
    }
    #post-list[data-view="moments"] > .post-card .post-header .post-user-info {
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    #post-list[data-view="moments"] > .post-card .post-header .post-display-name {
        font-size: 15px;
        font-weight: 600;
        color: #576b95;          /* 微信昵称蓝 */
        text-decoration: none;
        line-height: 1.3;
    }
    /* 微信视图：用户名(@handle)与昵称、时间统一显示在同一行 */
    #post-list[data-view="moments"] > .post-card .post-header .post-username {
        display: inline;
        font-size: 13px;
        color: #b2b2b2;
        white-space: nowrap;
    }
    #post-list[data-view="moments"] > .post-card .post-header .post-time {
        font-size: 12px;
        color: #b2b2b2;
        white-space: nowrap;
    }

    /* 正文：自然段落，不限行 */
    #post-list[data-view="moments"] > .post-card .post-content {
        font-size: 15px;
        line-height: 1.6;
        color: var(--text-primary);    /* 改：原 #1a1a1a → 主题色；卡片背景 var(--bg-primary) 在深色模式下为黑，文字必须跟随主题色保证可读 */
        padding: 0 0 8px;
        margin: 0;
        display: block;
        -webkit-line-clamp: unset;
        overflow: visible;
        word-break: break-word;
    }
    /* 图片区：重置小红书 cover，单图原始比例、多图 3 列网格 */
    #post-list[data-view="moments"] > .post-card .post-media-gallery,
    #post-list[data-view="moments"] > .post-card .post-image {
        width: 100% !important;
        margin: 0 0 8px;
        border: none;
        border-radius: 4px;
        overflow: hidden;
    }
    /* 多图：朋友圈视图强制恢复桌面端网格宫格（覆盖移动端 gallery-slider 横向轮播）。
       基类 .gallery-N 定义了各图数量的列数，此处只需还原 display:grid 并
       清掉轮播专用属性（横向滚动/吸附/满屏出血），即可回到 X.com 式宫格。 */
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-slider {
        display: grid !important;
        grid-template-columns: none;   /* 由下方 gallery-N 列数规则决定 */
        overflow: hidden;
        scroll-snap-type: none;
        -webkit-overflow-scrolling: auto;
        scrollbar-width: auto;
        gap: 2px;
        margin: 0 0 8px;
        width: 100% !important;
    }
    /* 与桌面端一致的图数量 → 列数映射（2/4 张两列，其余多图三列） */
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-2,
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-4 { grid-template-columns: repeat(2, 1fr); }
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-3,
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-5,
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-6,
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-7,
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-8,
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-9 { grid-template-columns: repeat(3, 1fr); }
    /* 清掉轮播对图项的限制，回到网格图项 */
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-slider .gallery-item {
        flex: none;
        width: auto;
        scroll-snap-align: none;
        border-radius: 0;
    }
    #post-list[data-view="moments"] > .post-card .gallery-item {
        max-height: none;
        aspect-ratio: 1 / 1;
    }
    #post-list[data-view="moments"] > .post-card .post-media-gallery .gallery-media,
    #post-list[data-view="moments"] > .post-card .post-media-gallery .gallery-img,
    #post-list[data-view="moments"] > .post-card .post-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        display: block;
        border-radius: 4px;
    }
    /* 单图：按原始比例 contain 居中，最大高度限制（朋友圈大图风格） */
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-1 .gallery-item,
    #post-list[data-view="moments"] > .post-card .post-image:not(:has(.gallery-item)) {
        aspect-ratio: auto;
        max-height: 360px;
    }
    #post-list[data-view="moments"] > .post-card .post-media-gallery.gallery-1 .gallery-img,
    #post-list[data-view="moments"] > .post-card .post-image:not(:has(.gallery-item)) img {
        object-fit: contain;
        background: var(--bg-secondary);   /* 改：原 #f2f2f2 → 主题次级色，深色模式下作为图片占位底色与卡片融为一体 */
    }

    /* 朋友圈右下角：".." 更多按钮（赞 / 评论），微信朋友圈风格 */
    #post-list[data-view="moments"] > .post-card .post-actions {
        display: flex !important;
        justify-content: flex-end;        /* 右对齐 */
        align-items: center;
        gap: 0;
        margin: 2px 0 6px;
        padding: 0;
        border: none;
        background: none;
        flex-wrap: wrap;
        position: relative;               /* 供 ".." 弹出菜单定位 */
    }
    /* 弹性占位把操作项推到最右 */
    #post-list[data-view="moments"] > .post-card .post-actions::before {
        content: "";
        flex: 1 1 auto;
    }
    /* 隐藏原点赞/评论直显按钮，由 ".." 弹出菜单接管（避免双入口） */
    #post-list[data-view="moments"] > .post-card .post-actions .like-btn,
    #post-list[data-view="moments"] > .post-card .post-actions .comment-btn { display: none !important; }
    /* ".." 更多按钮：圆形三点图标 */
    #post-list[data-view="moments"] > .post-card .post-actions .moments-more-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: none;
        color: #b2b2b2;
        cursor: pointer;
        font-family: inherit;
    }
    #post-list[data-view="moments"] > .post-card .post-actions .moments-more-btn:hover,
    #post-list[data-view="moments"] > .post-card .post-actions .moments-more-btn:active {
        background: var(--bg-secondary);
        color: #576b95;
    }
    /* ".." 弹出菜单：白底圆角气泡，从按钮上方弹出（微信风格）。
       显隐由 JS 内联 display:none/flex 控制；JS 打开时设为 flex 即横向排列"赞 / 评论"（同一行） */
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu {
        position: absolute;
        right: 0;
        bottom: calc(100% + 6px);
        z-index: 40;
        min-width: 132px;
        padding: 0;
        background: var(--bg-elevated, #fff);
        border: none;
        border-radius: 8px;
        box-shadow: 0 2px 14px rgba(0, 0, 0, .18);
    }
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu .menu-item {
        display: flex;
        flex: 1 1 0;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: auto;
        padding: 9px 12px;
        margin: 0;
        font-size: 14px;
        color: var(--text-primary);
        background: none;
        border: none;
        border-radius: 0;
        cursor: pointer;
        font-family: inherit;
        text-align: center;
        white-space: nowrap;
    }
    /* 两个按钮之间的分隔线（微信朋友圈风格） */
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu .menu-item + .menu-item {
        border-left: 1px solid var(--border-color, #e5e5e5);
    }
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu .menu-item:hover,
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu .menu-item:active {
        background: var(--bg-secondary);
    }
    /* 赞（红）/ 评论（蓝），微信朋友圈配色 */
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu .menu-item svg { color: #576b95; }
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu .menu-item.moments-like-item.liked,
    #post-list[data-view="moments"] > .post-card .post-actions .moments-action-menu .menu-item.moments-like-item.liked svg { color: #ff2442; }
    /* 书签在朋友圈不常用，弱化隐藏；转发组（含菜单）在朋友圈不展示以保持简洁 */
    #post-list[data-view="moments"] > .post-card .post-actions .bookmark-btn,
    #post-list[data-view="moments"] > .post-card .post-actions .repost-group { display: none !important; }
}

/* 手机端微信视图下，帖子详情页(.post-detail-main)的用户信息模块
   与首页/个人主页的 moments 信息流保持一致：小方形头像(左) + 昵称/@用户名/时间(右，同一行) */
@media (max-width: 700px) {
    .post-detail-main .post-card {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        flex-wrap: nowrap;   /* 强制头像与正文同行：基类 flex-wrap:wrap 会让 38+gap+正文(=内容区) 换行 */
    }
    /* 置顶帖：置顶徽章(.pinned-badge)是卡片的直接子元素，flex-basis:100% 需配合
       flex-wrap:wrap 才能独占一行。nowrap 会把徽章与头像/正文挤在同一行导致排版错乱。
       改回 wrap 并让正文 flex-basis:0，徽章独占首行、头像与正文仍保持同行。 */
    .post-detail-main .post-card.is-pinned {
        flex-wrap: wrap;
    }
    .post-detail-main .post-card.is-pinned > .post-body {
        flex: 1 1 0;
        min-width: 0;
    }
    /* 徽章缩进对齐手机端头像右缘（38px 头像 + 8px gap = 46px） */
    .post-detail-main .post-card.is-pinned .pinned-badge {
        margin-left: 46px;
    }
    /* 置顶帖媒体：同样用 100% 填充 body 宽度，避免在详情页被固定 -62px 负偏移推出屏幕。 */
    .post-detail-main .post-card.is-pinned .post-media-gallery,
    .post-detail-main .post-card.is-pinned .post-image {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100%;
    }
    .post-detail-main .post-avatar {
        width: 38px;
        flex: 0 0 38px;
        margin: 0;
    }
    .post-detail-main .post-avatar .avatar-md {
        width: 38px;
        height: 38px;
        border-radius: 4px;
    }
    .post-detail-main .post-body {
        flex: 1 1 auto;
        min-width: 0;
        display: block;
    }
    .post-detail-main .post-header {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
        padding: 0 0 4px;
    }
    .post-detail-main .post-user-info {
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .post-detail-main .post-display-name {
        font-size: 15px;
        font-weight: 600;
        color: #576b95;
        line-height: 1.3;
    }
    .post-detail-main .post-username {
        font-size: 13px;
        color: #b2b2b2;
        white-space: nowrap;
    }
    .post-detail-main .post-time {
        font-size: 12px;
        color: #b2b2b2;
        white-space: nowrap;
    }
    /* 评论区(.comments-section-detail 在 .post-detail-main 之外)与嵌套的转发帖：
       同样保证头像与发帖人信息同行 */
    .comments-section-detail .post-card,
    .post-detail-main .quoted-post .post-card {
        flex-wrap: nowrap;
        align-items: flex-start;
    }
}
/* 手机端通用：帖子头部（发帖人头像/昵称/@用户名/时间）强制单行显示。
   昵称过长时截断省略，@用户名与时间保持在同一行完整可见，
   解决窄屏下 @用户名被挤到第二行、导致头像、昵称、用户名不在同一行的问题
   （覆盖探索/书签/搜索等使用默认 X.com 样式卡片布局的页面） */
@media (max-width: 700px) {
    .post-user-info {
        flex-wrap: nowrap;
        white-space: nowrap;
        min-width: 0;
        overflow: hidden;
    }
    .post-user-info .post-display-name {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .post-user-info .post-username,
    .post-user-info .post-dot,
    .post-user-info .post-time,
    .post-user-info .post-edited,
    .post-user-info .post-scheduled {
        flex-shrink: 0;
        white-space: nowrap;
    }
}
/* 手机端帖子"更多"菜单统一为底部弹出面板（Action Sheet 风格）：
   - 触控项最小高度 48px（≥ 44px 触控标准），图标 20px、字号 15px
   - 普通操作 / 危险操作（删除，红底）/ 取消（灰底）三段视觉层级清晰
   - 避免被卡片 overflow 裁剪，符合移动端拇指操作习惯（小红书/朋友圈/详情页通用） */
@media (max-width: 700px) {
    /* 手机端：帖子"更多"菜单仅保留在帖子详情页（主帖 + 评论区），
       首页/个人主页/探索等列表页一律隐藏（小红书/朋友圈视图均覆盖） */
    .post-menu { display: none !important; }
    .post-detail-main .post-menu,
    .comments-section-detail .post-menu { display: block !important; }
    /* 手机端帖子"更多"菜单沿用桌面端下拉样式（absolute 定位在按钮下方、
       紧凑内容宽度、危险项红字分隔），不再使用底部 Action Sheet 面板，
       与电脑端排版设计保持一致 */
}
/* 下拉菜单不显示取消按钮（点击外部即关闭）——桌面端与手机端一致 */
.menu-cancel { display: none !important; }
/* 桌面端（>700px）及详情页/其他列表：始终隐藏手机卡片页脚 */
.post-card-foot-m { display: none; }
@media (min-width: 1100px) {
    .media-grid { gap: 4px; }
}

/* --- 已置顶标记（X.com 风格） --- */
/* 置顶指示显示在头像列正上方：左缩进对齐到头像（头像 40px + gap 10px ≈ 50px） */
.pinned-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-basis: 100%;
    margin-left: 50px;
    padding: 4px 0 2px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}
.pinned-badge svg { flex-shrink: 0; }
.pinned-text { line-height: 1; }

/* 置顶帖整体视觉区分：浅色背景 + 上下分隔线，使其在列表中突出（仿 X.com） */
.post-card.is-pinned {
    background: var(--bg-hover, rgba(255, 255, 255, 0.03));
    border-bottom: 1px solid var(--border-color);
}
/* 详情页/嵌套场景不强制背景，避免叠加突兀 */
.post-detail-main .post-card.is-pinned,
.quoted-post .post-card.is-pinned {
    background: transparent;
}
/* 私密帖整体视觉区分：浅色背景 + 顶部标识栏，排版语言与 X.com 置顶帖一致 */
.post-card.is-private {
    background: var(--bg-hover, rgba(29, 155, 240, 0.04));
}
.post-detail-main .post-card.is-private,
.quoted-post .post-card.is-private {
    background: transparent;
}
.private-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-basis: 100%;
    /* 全宽背景横条：负外边距抵消卡片内边距（含横向出血 margin），形成置顶式标识栏 */
    margin: -12px -16px 0;
    padding: 10px 16px;
    background: rgba(29, 155, 240, 0.10);
    color: var(--accent, #1d9bf0);
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}
.private-badge svg { flex-shrink: 0; fill: var(--accent, #1d9bf0); }
/* --- 转发内嵌的原帖卡片（X.com 引用推文风格） --- */
.quoted-post {
    margin: 10px 0 4px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}
.quoted-post .post-card {
    border: none;
    border-radius: 0;
    padding: 12px;
    /* 引用帖嵌套在主帖卡片内，取消出血，避免相对主帖内容区叠加错位 */
    margin: 0;
}
.quoted-post .post-card:hover {
    background: rgba(255, 255, 255, 0.03);
}
.quoted-post .repost-indicator { display: none; }
/* 详情页中 .post-detail-main .post-avatar 为绝对定位、.post-header 有 padding-left，
   会级联到内嵌引用卡片，造成"原帖人头像"与"转贴人头像"重叠、内嵌卡片文字错位。
   此处重置内嵌卡片为普通流式布局，避免继承详情页的特殊定位。 */
.post-detail-main .quoted-post .post-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    min-width: 0;
}
.post-detail-main .quoted-post .post-avatar {
    position: static;
    top: auto;
    left: auto;
}
.post-detail-main .quoted-post .post-header {
    padding-left: 0;
    min-height: 0;
}
.post-detail-main .quoted-post .post-display-name {
    font-size: 15px;
}
.post-detail-main .quoted-post .post-username,
.post-detail-main .quoted-post .post-dot {
    font-size: 14px;
}
.post-detail-main .quoted-post .avatar-md {
    width: 40px;
    height: 40px;
}
.post-detail-main .quoted-post .post-content {
    font-size: 15px;
    line-height: 1.4;
    margin: 2px 0 6px;
}

/* --- 帖子卡片"更多"菜单中的置顶按钮悬停 --- */
.post-menu-btn:hover { color: var(--accent) !important; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state h2 { font-size: 20px; color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { margin-bottom: 16px; }

/* --- Load More --- */
.load-more {
    text-align: center;
    padding: 20px;
}

/* --- 首页无限滚动（X.com 风格瀑布流）--- */
#feed-sentinel {
    width: 100%;
    height: 1px;
}
.feed-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 0;
}
.feed-loading .spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: feedSpin 0.8s linear infinite;
}
@keyframes feedSpin {
    to { transform: rotate(360deg); }
}
.feed-end {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 24px 0;
}

/* --- 个人主页无限滚动：骨架屏（Skeleton Screen）--- */
.infinite-scroll-foot {
    width: 100%;
}
.profile-skeleton-wrap {
    display: block;
}
.skeleton-card {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary, #fff);
}
.sk-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: linear-gradient(90deg, var(--skeleton-base, #e9eef1) 25%, var(--skeleton-shine, #f4f7f9) 37%, var(--skeleton-base, #e9eef1) 63%);
    background-size: 400% 100%;
    animation: skShine 1.3s ease-in-out infinite;
}
.sk-body {
    flex: 1 1 auto;
    min-width: 0;
}
.sk-line {
    height: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--skeleton-base, #e9eef1) 25%, var(--skeleton-shine, #f4f7f9) 37%, var(--skeleton-base, #e9eef1) 63%);
    background-size: 400% 100%;
    animation: skShine 1.3s ease-in-out infinite;
}
.sk-line-name { width: 30%; height: 12px; }
.sk-line-handle { width: 20%; }
.sk-line-text { width: 92%; }
.sk-line-text.short { width: 60%; margin-bottom: 0; }
@keyframes skShine {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
/* 虚拟列表回收占位锚点 */
.post-card-recycled {
    width: 100%;
}
@media (prefers-reduced-motion: reduce) {
    .sk-avatar, .sk-line { animation: none; }
}

/* --- Right Sidebar --- */
.right-sidebar {
    width: var(--right-sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    padding: 8px 24px;
    overflow-y: auto;
    transition: width .25s ease, padding .25s ease;
}

/* 右侧栏折叠开关（网盘页；展开态位于侧栏右上角，折叠态转为页面右缘悬浮钮） */
.right-sidebar-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}
.right-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-elevated, var(--bg-primary));
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.right-sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
/* 折叠态：侧栏收成 0 宽，开关 fixed 到页面右缘，图标反转（右箭头→左箭头） */
.right-sidebar.collapsed {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border: none;
    overflow: hidden;
}
.right-sidebar.collapsed .right-sidebar-toggle {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
}
.right-sidebar.collapsed .right-sidebar-toggle svg { transform: rotate(180deg); }
/* 折叠任一侧栏后主内容自动加宽（网盘页专属） */
body[data-page="pan"].left-collapsed .main-content,
body[data-page="pan"].right-collapsed .main-content {
    max-width: 100%;
}
.right-section {
    margin-bottom: 16px;
}
.right-title {
    font-size: 20px;
    font-weight: 800;
    padding: 12px 16px;
    margin-bottom: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: 28px;
    padding: 0 12px;
    margin-top: 4px;
    transition: all .2s;
}
.search-box:focus-within { border-color: var(--accent); background: transparent; }
.search-box svg { flex-shrink: 0; }
.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 12px 0;
    outline: none;
}
.search-box input::placeholder { color: var(--text-secondary); }

/* ===== 首页搜索框「最近搜索」下拉面板（X.com 风格） ===== */
/* 使用 fixed 浮层，脱离 .right-sidebar 的 overflow:auto 裁剪 */
.recent-search-dropdown {
    position: fixed;
    z-index: 1000;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    overflow: hidden;
}
.recent-search-dropdown[hidden] { display: none; }
.recent-search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}
.recent-search-clear-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 4px;
}
.recent-search-clear-all:hover { text-decoration: underline; }
.recent-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .15s;
}
.recent-search-item:hover { background: var(--bg-hover); }
.recent-search-item .rs-icon {
    flex-shrink: 0;
    color: var(--text-secondary);
}
.recent-search-item .rs-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-search-item .rs-del {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--accent);
    background: rgba(29,155,240,.12);
    border: none;
    cursor: pointer;
    transition: background .15s;
}
.recent-search-item .rs-del:hover { background: rgba(29,155,240,.22); }
.recent-search-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.trending-card, .suggested-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
}

.trending-item {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    transition: background .2s;
}
.trending-item:hover { background: var(--bg-hover); text-decoration: none; }
.trending-tag { font-size: 15px; font-weight: 700; }
.trending-count { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.suggested-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    transition: background .2s;
}
.suggested-item:hover { background: var(--bg-hover); }
.suggested-avatar-link { flex-shrink: 0; display: flex; line-height: 0; }
.suggested-info { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.suggested-info:hover .suggested-name { text-decoration: underline; }
.suggested-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 2px; }
.suggested-handle { font-size: 13px; color: var(--text-secondary); }
.suggested-follow-btn { flex-shrink: 0; min-width: 76px; align-self: center; }

.footer-links {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { text-decoration: underline; }
.copyright { color: var(--text-secondary); }

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
}
.modal.show {
    display: flex;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(91,112,131,.4);
}
.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 12px 0;
}
.modal-header {
    display: flex;
    align-items: center;
    padding: 0 8px 8px;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    transition: background .2s;
}
.modal-close:hover { background: var(--bg-hover); }

/* 标题栏发布按钮：仅移动端显示（桌面端发帖按钮在底部操作栏） */
.compose-header-submit { display: none; }

/* --- 账号快捷切换弹层（X.com Account Switcher 风格） --- */
.account-switcher-content {
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    padding: 0;
    background: var(--bg-elevated, var(--bg-primary));
}
.account-switcher-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}
.account-switcher-head h2 { font-size: 19px; font-weight: 800; }
.account-switcher-list { padding: 4px 8px; overflow-y: auto; max-height: 50vh; }
.account-switcher-loading { padding: 20px; text-align: center; color: var(--text-secondary); }

.as-account {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    transition: background .15s;
}
.as-account:hover { background: var(--bg-hover); }
.as-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.as-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.as-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-handle { color: var(--text-secondary); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-account.is-current .as-name { color: var(--text-primary); }
.as-check { flex-shrink: 0; }

.account-switcher-actions {
    border-top: 1px solid var(--border-color);
    padding: 8px;
}
.account-switcher-add,
.account-switcher-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font-size: 15px;
    transition: background .15s;
}
.account-switcher-add:hover,
.account-switcher-logout:hover { background: var(--bg-hover); }
.account-switcher-add { color: var(--accent); font-weight: 700; }
.account-switcher-logout { color: var(--text-primary); }

.compose-form { padding: 0 16px; }
.compose-body {
    display: flex;
    gap: 12px;
}
.compose-body textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 19px;
    resize: none;
    outline: none;
    min-height: 120px;
    height: 120px;          /* 基线高度，由 JS 按内容动态覆盖 */
    max-height: 40vh;       /* 随内容增高，上限为屏幕 40%（与 x.com 一致），超出后内部滚动 */
    overflow-y: auto;
    align-self: flex-start; /* 避免 flex 交叉轴拉伸干扰自动高度 */
}
.compose-body textarea::placeholder { color: var(--text-secondary); }

.compose-char-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
    z-index: 9;
}
.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    margin-right: 12px;
}
.mobile-logo {
    font-size: 18px;
    font-weight: 700;
}

/* --- Search Header --- */
.search-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border-radius: 28px;
    padding: 0 14px;
}
.search-form input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 10px 0;
    outline: none;
}
.search-result-title {
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}
/* 搜索结果筛选 Tab（全部 / 仅位置） */
.result-tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}
.result-tab {
    position: relative;
    padding: 12px 6px;
    margin-right: 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color .15s;
}
.result-tab:hover { color: var(--text-primary); }
.result-tab.active {
    color: var(--text-primary);
    border-bottom-color: rgb(29,155,240);
}
.result-tab.active:hover { color: var(--text-primary); }

/* 搜索结果选项卡（复刻 x.com：热门/最新/用户/媒体/群组） */
.search-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.search-tab {
    position: relative;
    flex: 1 1 0;
    padding: 16px 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.search-tab:hover { color: var(--text-primary); background: rgba(29,155,240,.08); }
.search-tab.active { color: var(--text-primary); font-weight: 700; }
.search-tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0;
    border-radius: 3px;
    background: rgb(29,155,240);
    transition: transform .2s ease, width .2s ease;
    pointer-events: none;
}
#search-results.loading { opacity: .55; transition: opacity .15s; }

/* 群组选项卡空态（仿 x.com 搜索空态） */
.search-empty {
    padding: 48px 20px;
    text-align: center;
}
.search-empty h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.search-empty p { color: var(--text-secondary); font-size: 15px; }

/* --- 地点专区两列布局（仅位置筛选时生效） --- */
.location-layout { width: 100%; }
.location-layout.has-sidebar {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.location-layout.has-sidebar .post-feed { flex: 1 1 auto; min-width: 0; }
.location-layout.has-sidebar .location-sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 64px;
    align-self: flex-start;
}

/* 地图预览卡（无 Key 时为装饰占位） */
.location-map-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-primary);
}
.location-map-preview {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #e8f0fe 0%, #f3f8ff 100%);
    overflow: hidden;
}
/* 真实高德地图容器（默认隐藏，带 Key 且有坐标时由 JS 显示） */
.location-amap {
    position: absolute;
    inset: 0;
    display: none;
    z-index: 1;
}
html[data-theme="dark"] .location-amap .amap-logo,
html[data-theme="dark"] .location-amap .amap-copyright { opacity: .6; }
/* 高德信息窗体卡片 */
.amap-info-card {
    padding: 8px 12px;
    min-width: 140px;
    font-family: inherit;
}
.amap-info-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f1419;
    margin-bottom: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.amap-info-link {
    font-size: 12px;
    color: rgb(29,155,240);
    text-decoration: none;
}
.amap-info-link:hover { text-decoration: underline; }
/* 装饰占位（无 Key / 加载失败时显示）覆盖预览区 */
.map-decor {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
html[data-theme="dark"] .location-map-preview {
    background: linear-gradient(135deg, #1b2735 0%, #16202c 100%);
}
.map-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(29,155,240,.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(29,155,240,.18) 1px, transparent 1px);
    background-size: 28px 28px;
}
.map-pin {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    background: rgb(29,155,240);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.map-caption {
    position: absolute;
    left: 12px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(255,255,255,.6);
}
.map-caption strong { font-size: 14px; color: #0f1419; }
.map-caption span { font-size: 12px; color: #536471; }
html[data-theme="dark"] .map-caption strong { color: #e7e9ea; }
html[data-theme="dark"] .map-caption span { color: #8b98a5; }
.location-map-badge {
    padding: 8px 12px;
    font-size: 12px;
    color: #00ba7c;
    border-top: 1px solid var(--border-color);
}
.location-map-badge.muted { color: var(--text-secondary); }

/* 地点列表面板 */
.location-list-card {
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    overflow: hidden;
}
.location-list-title {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color);
}
.location-list { list-style: none; margin: 0; padding: 0; }
.location-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}
.location-list-item:last-child { border-bottom: none; }
.location-list-item:hover { background: var(--bg-hover); }
/* 选中（与地图联动）高亮 */
.location-list-item.active {
    background: rgba(29,155,240,0.12);
    box-shadow: inset 3px 0 0 rgb(29,155,240);
}
.location-list-item.active .location-list-name { color: rgb(29,155,240); font-weight: 700; }
.amap-info-sub { font-size: 12px; color: var(--text-secondary); }
/* 地图联动时的高亮动画 */
.location-amap.map-focus { animation: mapFocusPulse 0.9s ease-out 1; }
@keyframes mapFocusPulse {
    0%   { box-shadow: inset 0 0 0 0 rgba(29,155,240,0.0); }
    35%  { box-shadow: inset 0 0 0 4px rgba(29,155,240,0.55); }
    100% { box-shadow: inset 0 0 0 0 rgba(29,155,240,0.0); }
}
.location-list-icon { color: rgb(29,155,240); flex: 0 0 auto; }
.location-list-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}
.location-list-count {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 9999px;
    padding: 2px 8px;
}

/* 窄屏：侧栏堆叠到内容下方，恢复单列 */
@media (max-width: 900px) {
    .location-layout.has-sidebar { flex-direction: column; }
    .location-layout.has-sidebar .location-sidebar { flex-basis: auto; width: 100%; position: static; }
}

/* --- User Card (search) --- */
.user-search-results { border-bottom: 1px solid var(--border-color); }
.user-card {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background .2s;
    border-bottom: 1px solid var(--border-color);
}
.user-card:hover { background: var(--bg-hover); text-decoration: none; }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 2px; }
.user-card-handle { color: var(--text-secondary); font-size: 14px; }
.user-card-bio { font-size: 14px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Notifications --- */
.notification-list {}
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background .2s;
}
.notification-item.unread {
    background: rgba(29,155,240,.04);
}
.notification-item:hover { background: var(--bg-hover); }
.notification-icon { flex-shrink: 0; width: 32px; display: flex; justify-content: flex-end; padding-top: 4px; }
.notification-content {
    flex: 1;
    display: flex;
    gap: 10px;
    min-width: 0;
}
.notification-text { font-size: 14px; margin-bottom: 2px; }
.notification-text strong { font-weight: 700; }
.notification-time { font-size: 13px; color: var(--text-secondary); }
.notification-link {
    color: var(--text-secondary);
    padding: 4px;
    flex-shrink: 0;
}
.notification-link:hover { color: var(--accent); }

/* --- Settings --- */
.settings-section {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
    max-width: var(--max-content-width);
    margin: 0 auto;
}
.settings-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* 设置中心分区大标题（按"公开→私密→安全→系统"递进分组） */
.settings-section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    max-width: var(--max-content-width);
    margin: 28px auto 12px;
    padding: 0 2px;
}
.settings-section-title:first-of-type { margin-top: 8px; }
.settings-section-title h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: .2px;
}
.settings-section-title .settings-section-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.settings-section-title .settings-section-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 表单控件通用样式 */
.settings-form .form-group { margin-bottom: 18px; }
.settings-form .form-group-inline { margin-bottom: 18px; }
.settings-form .setting-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    margin: 0;
}
.settings-form .setting-toggle input { width: 16px; height: 16px; accent-color: var(--accent, #1d9bf0); cursor: pointer; }

/* 侧边栏栏目开关（设置页 · Switch 样式） */
.sidebar-toggle-list { display: flex; flex-direction: column; gap: 2px; }
.sidebar-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 2px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-toggle-row:last-child { border-bottom: none; }
.sidebar-toggle-label { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.sidebar-toggle-row .setting-toggle { display: inline-flex; align-items: center; margin: 0; position: relative; cursor: pointer; }
.sidebar-toggle-row .setting-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.sidebar-toggle-row .setting-toggle .setting-toggle-slider {
    position: relative; width: 44px; height: 24px; border-radius: 24px;
    background: var(--border-color); transition: background .2s; flex-shrink: 0;
}
.sidebar-toggle-row .setting-toggle .setting-toggle-slider::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .2s;
}
.sidebar-toggle-row .setting-toggle input:checked + .setting-toggle-slider { background: var(--accent); }
.sidebar-toggle-row .setting-toggle input:checked + .setting-toggle-slider::after { transform: translateX(20px); }
.sidebar-toggle-row .setting-toggle input:focus-visible + .setting-toggle-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 侧边栏导航项：用户关闭对应栏目时隐藏（需覆盖 .nav-item 的 display:inline-flex） */
.sidebar .nav-item[hidden] { display: none; }
.settings-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.settings-form .form-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 4px 0 18px;
    cursor: pointer;
}
.settings-form .form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent, #1d9bf0);
    cursor: pointer;
}
.settings-form input[type="text"],
.settings-form input[type="url"],
.settings-form input[type="email"],
.settings-form input[type="password"],
.settings-form input[type="date"],
.settings-form textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.4;
    resize: vertical;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.settings-form input::placeholder,
.settings-form textarea::placeholder { color: var(--text-muted, #8899a6); }
.settings-form input:focus,
.settings-form textarea:focus {
    border-color: var(--accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
    outline: none;
}
.settings-form .btn { margin-top: 4px; }
.settings-form-inline { display: flex; align-items: center; }

/* 头像上传：预览图 + 操作区纵向排列 */
.avatar-upload-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.avatar-upload-row .avatar-xl {
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.avatar-upload-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 200px;
}
.avatar-upload-main input[type="file"] {
    flex: 1;
    min-width: 160px;
    font-size: 14px;
    color: var(--text-secondary);
}
.settings-form-inline .btn { white-space: nowrap; }

/* 卡片头部：左侧色条 + 标题/描述，强化层级与辨识度 */
.settings-card-head {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
}
.settings-card-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 卡片内只读概览与表单之间的分隔 */
.settings-divider {
    height: 0;
    border-top: 1px solid var(--border-color);
    margin: 4px 0 16px;
}

/* 表单底部操作区：按钮右对齐、统一间距与微交互 */
.settings-form .form-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.settings-form .form-actions .btn { margin-top: 0; }

/* 两列表单网格（如网站 / 位置） */
.settings-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
}

/* 设置表单行内错误提示（如邮箱格式/长度） */
.field-error {
    display: block;
    min-height: 16px;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--danger, #e0245e);
}
.input-invalid {
    border-color: var(--danger, #e0245e) !important;
}

/* 设置分组卡片（参照 x.com / 抖音设置页） */
.settings-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin: 0 auto 18px;
    max-width: var(--max-content-width);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.settings-card-head h2 { font-size: 18px; font-weight: 700; }
.settings-card .settings-form { padding: 20px; }
.settings-card .settings-form-inline { padding: 16px; }

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 15px; color: var(--text-primary); flex-shrink: 0; }
.settings-row-value { font-size: 14px; color: var(--text-secondary); word-break: break-all; text-align: right; }

.settings-hint {
    padding: 16px 20px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.settings-card-danger {
    border-color: color-mix(in srgb, var(--danger, #e0245e) 45%, var(--border-color));
}
.settings-card-danger .settings-card-head {
    border-left-color: var(--danger, #e0245e);
    border-bottom-color: color-mix(in srgb, var(--danger, #e0245e) 30%, var(--border-color));
}
.settings-card-danger .settings-form { padding-top: 16px; }

/* 外观主题选项：精致色卡，选中态高亮 */
.settings-theme-options { display: flex; gap: 16px; margin-bottom: 4px; flex-wrap: wrap; }
.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    transition: border-color .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.theme-option:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.theme-option input { display: none; }
.theme-option.selected {
    border-color: var(--accent);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-primary));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.theme-swatch { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--border-color); box-shadow: inset 0 0 0 2px rgba(255,255,255,.06); }
.theme-swatch-dark { background: linear-gradient(135deg, #15202b 0%, #1d9bf0 160%); }
.theme-swatch-light { background: linear-gradient(135deg, #ffffff 0%, #1d9bf0 160%); }
.lang-label { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); font-size: 15px; font-weight: 700; letter-spacing: .03em; background: var(--bg-primary); box-shadow: inset 0 0 0 2px rgba(255,255,255,.06); }
.theme-option.selected .lang-label { color: var(--accent); border-color: var(--accent); }

/* 下拉选择框统一样式（与文本输入一致） */
.settings-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.4;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='%2371767b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.settings-select:focus {
    border-color: var(--accent);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
    outline: none;
}

/* 详细住址：国家/省/市/区 级联选择器 */
.region-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
.region-picker #region-country { grid-column: 1 / -1; }
.region-picker .settings-select { width: 100%; }
#region-detail {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
#region-detail:focus {
    border-color: var(--accent);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
    outline: none;
}
#region-detail::placeholder { color: var(--text-secondary); }
.settings-form .region-picker + #region-detail { margin-top: 0; }

/* 私密信息卡片：左侧用强调色（隐私蓝）色条，提示敏感 */
.settings-card-private .settings-card-head {
    border-left-color: #794bc4;
}
.settings-card-private .settings-card-desc strong {
    color: #794bc4;
    font-weight: 600;
}

/* ============================================ */
/* 回复权限选择器（X.com 风格）                 */
/* ============================================ */

/* -- 回复规则标识（帖子上的 Badge） -- */
.reply-restriction-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: default;
}

/* -- "谁可以回复" 下拉 -- */
.reply-audience-select {
    position: relative;
}
.reply-audience-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.reply-audience-btn:hover {
    background: rgba(29, 155, 240, 0.1);
}

/* -- 下拉面板 -- */
.reply-audience-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 260px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 0 15px rgba(0,0,0,.15);
    z-index: 30;
    overflow: hidden;
}
.reply-audience-title {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 800;
    border-bottom: 1px solid var(--border-color);
}
.reply-audience-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .15s;
}
.reply-audience-option:hover { background: var(--bg-hover); }
.reply-audience-option .ra-icon { flex-shrink: 0; width: 24px; text-align: center; }
.reply-audience-option .ra-label { flex: 1; font-size: 14px; font-weight: 500; }
.reply-audience-option .ra-check { display: none; }
.reply-audience-option.selected .ra-check { display: flex; }
.reply-audience-option.selected .ra-label { color: var(--accent); }

/* -- 回复被限制提示 -- */
.comment-disabled-hint {
    padding: 12px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}
.comment-disabled-hint a { color: var(--accent); }

/* -- 发帖底部操作栏 -- */
.compose-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
}
.compose-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.compose-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* -- 回复预览条 -- */
.compose-reply-to {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 0 12px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}
.reply-to-cancel {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}
.reply-to-cancel:hover { color: var(--danger); }

/* -- 编辑中提示横幅 -- */
.compose-edit-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #1d9bf0;
    background: rgba(29, 155, 240, .08);
    border: 1px solid rgba(29, 155, 240, .25);
    border-radius: 8px;
}
.compose-edit-banner span { font-weight: 600; }

/* -- 发布时间编辑（超级管理员编辑主帖时） -- */
.compose-time-edit {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary, #f7f9f9);
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    font-size: 14px;
}
.compose-time-label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}
.compose-time-input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}
.compose-time-hint {
    font-size: 12px;
    color: var(--text-secondary, #888);
    white-space: nowrap;
}

/* -- 引用转发预览卡 -- */
.compose-quote-preview {
    margin: 0 12px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    overflow: hidden;
}
.quote-preview-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.quote-preview-head .reply-to-cancel {
    margin-left: auto;
    font-size: 18px;
}
.quote-preview-card { padding: 10px 12px; }
.quote-loading { color: var(--text-secondary); font-size: 13px; padding: 6px 0; }
.qp-card { display: flex; flex-direction: column; gap: 6px; }
.qp-head { display: flex; align-items: center; gap: 6px; }
.qp-head .avatar-sm { width: 24px; height: 24px; }
.qp-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.qp-handle { font-size: 13px; color: var(--text-secondary); }
.qp-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    max-height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.quote-media-hint { font-size: 13px; color: var(--accent); }

/* -- 转发按钮组 + 下拉菜单 -- */
.action-group { position: relative; display: flex; align-items: center; }
.repost-caret {
    padding: 0 4px;
    margin-left: -4px;
    opacity: 0.7;
}
.repost-caret:hover { opacity: 1; background: rgba(0,186,124,0.1); }
.repost-btn.reposted, .repost-btn.reposted:hover { color: var(--repost); }
.repost-btn.reposted .repost-count { color: var(--repost); }

.menu-dropdown.repost-menu {
    position: absolute;
    bottom: 130%;
    left: 0;
    min-width: 160px;
    background: var(--bg-elevated, #15202b);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 4px;
    z-index: 50;
}
.repost-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}
.repost-menu .menu-item:hover { background: var(--bg-secondary); }
.repost-menu .menu-item svg { color: var(--repost); }

/* -- Toast 轻提示 -- */
#toast-container {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: var(--repost, #00ba7c);
    color: #fff;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .25s, transform .25s;
    pointer-events: auto;
}
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast.toast-error { background: #f4212e; }
.toast.toast-info { background: #536471; }
.toast .toast-action {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 9999px;
    cursor: pointer;
}
.toast .toast-action:hover { background: rgba(255,255,255,0.32); }

/* ============================================ */
/* 图片/媒体预览 (发帖)                         */
/* ============================================ */
.compose-media-preview {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 0 12px;
    margin-bottom: 8px;
}
.compose-media-preview:has(.compose-media-item:only-child) {
    grid-template-columns: 1fr;
}

/* 上传进度卡片：跨整行，实时展示单个文件的上传百分比 */
.compose-media-item.compose-media-progress {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f7f9f9;
    border: 1px solid #eff3f4;
    border-radius: 12px;
}
.compose-media-progress .compose-media-thumb {
    position: static;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 36px;
    text-align: center;
    background: #eff3f4;
}
.compose-progress-meta {
    flex: 1 1 auto;
    min-width: 0;
}
.compose-progress-name {
    font-size: 13px;
    color: #0f1419;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.compose-progress-status {
    font-size: 12px;
    color: #536471;
    margin-bottom: 6px;
}
.compose-progress-bar {
    width: 100%;
    height: 6px;
    background: #e1e8ed;
    border-radius: 3px;
    overflow: hidden;
}
.compose-progress-fill {
    width: 0%;
    height: 100%;
    background: #1d9bf0;
    border-radius: 3px;
    transition: width 0.15s ease;
}
/* 进度未知（lengthComputable=false）时的缓冲动画，保证进度条始终可见 */
.compose-media-progress.indeterminate .compose-progress-fill {
    width: 40% !important;
    animation: compose-progress-indeterminate 1.1s ease-in-out infinite;
}
@keyframes compose-progress-indeterminate {
    0%   { margin-left: -40%; }
    100% { margin-left: 100%; }
}
.compose-progress-error {
    font-size: 12px;
    color: #d1242f;
    margin-top: 6px;
    min-height: 0;
}
.compose-media-progress.compose-progress-error-state .compose-progress-fill {
    background: #d1242f;
}

/* 进度卡：入场淡入 / 退场淡出，避免突兀闪烁 */
.compose-media-item.compose-media-progress {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.compose-media-item.compose-media-progress.compose-progress-in {
    opacity: 1;
    transform: translateY(0);
}
.compose-media-item.compose-media-progress.compose-progress-out {
    opacity: 0;
    transform: translateY(-4px);
}

/* 完成态：进度条与状态文字转为绿色，缩略图加 ✓ 角标感 */
.compose-media-progress.compose-progress-done .compose-progress-fill {
    background: #00ba7c;
}
.compose-media-progress.compose-progress-done .compose-progress-status {
    color: #00ba7c;
    font-weight: 600;
}

/* 网盘上传进度容器：挂载多张复用发帖的进度卡片，纵向堆叠，与下方列表留白 */
.drive-upload-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 14px;
}
/* 网盘容器不受 compose 网格影响，显式覆盖跨列属性（compose 中为 grid-column:1/-1） */
.drive-upload-progress .compose-media-progress {
    grid-column: auto;
}

/* 手动关闭按钮（默认隐藏，错误态显示） */
.compose-progress-close {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-left: auto;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    font-size: 18px;
    color: #536471;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.compose-progress-close:hover {
    background: #e1e8ed;
}
.compose-media-progress.compose-progress-error-state .compose-progress-close {
    opacity: 1;
    pointer-events: auto;
}

/* 聚合总进度条：多文件时展示整体进度 */
.compose-upload-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #e8f5fe;
    border: 1px solid #cfe9fb;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.3s ease;
}
.compose-upload-summary.compose-progress-in,
.compose-upload-summary:not([style*="opacity: 0"]) {
    opacity: 1;
    transform: translateY(0);
}
.compose-upload-summary.compose-upload-summary-done {
    background: #e6f8f1;
    border-color: #b8ecd8;
}
.compose-upload-summary-text {
    flex: 0 0 auto;
    font-size: 12.5px;
    color: #0f1419;
    white-space: nowrap;
}
.compose-upload-summary-bar {
    flex: 1 1 auto;
    height: 6px;
    background: #cfe9fb;
    border-radius: 3px;
    overflow: hidden;
}
.compose-upload-summary-fill {
    width: 0%;
    height: 100%;
    background: #1d9bf0;
    border-radius: 3px;
    transition: width 0.2s ease;
}
.compose-upload-summary-done .compose-upload-summary-fill {
    background: #00ba7c;
}

/* 地理位置已选展示条 */
.compose-location-box {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 12px 10px;
    padding: 8px 10px;
    background: #eff3f4;
    border: 1px solid #cfd9de;
    border-radius: 8px;
}
.compose-location-box svg { flex: 0 0 auto; color: rgb(29,155,240); }
.compose-location-text {
    flex: 1 1 auto;
    font-size: 14px;
    color: #0f1419;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.location-clear {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #536471;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.location-clear:hover { color: #0f1419; }
/* 工具按钮激活态 */
.compose-tool-btn.active svg { opacity: 1; }
.compose-tool-btn.active { background: rgba(29,155,240,0.12); border-radius: 9999px; }


/* 位置选择浮层（微信式） */
.location-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 9999;
}
.location-picker {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: lpUp .2s ease;
}
@keyframes lpUp { from { transform: translateY(20px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.location-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-weight: 700;
    border-bottom: 1px solid #eff3f4;
}
.location-picker-close {
    border: none; background: transparent; font-size: 22px; line-height: 1;
    color: #536471; cursor: pointer;
}
.location-picker-search { padding: 10px 12px; }
.location-search-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfd9de;
    border-radius: 9999px;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
}
.location-search-input:focus { border-color: rgb(29,155,240); }
.location-picker-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px 0 8px;
}
.location-picker-loading, .location-picker-empty {
    padding: 16px;
    color: #536471;
    font-size: 13px;
    text-align: center;
}
.location-picker-item {
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f7f9f9;
}
.location-picker-item:hover { background: #f7f9f9; }
.lpi-name { font-size: 14px; color: #0f1419; }
.lpi-sub { font-size: 12px; color: #536471; margin-top: 2px; }
.location-picker-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #eff3f4;
}
.location-picker-current {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #cfd9de;
    background: #fff;
    border-radius: 9999px;
    padding: 9px;
    font-size: 14px;
    color: #0f1419;
    cursor: pointer;
}
.location-picker-confirm {
    flex: 0 0 auto;
    min-width: 76px;
    border: none;
    background: rgb(29,155,240);
    color: #fff;
    border-radius: 9999px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.location-picker-confirm:disabled { opacity: .5; cursor: not-allowed; }

/* 帖子地理位置展示 */
.post-location {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
    padding: 0 12px;
    font-size: 14px;
    color: #536471;
}
.post-location svg { color: #71767b; }
.post-location-link {
    color: rgb(29,155,240);
    text-decoration: none;
}
.post-location-link:hover { text-decoration: underline; }
.post-location-dist { color: #536471; }

.compose-media-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
}
.compose-media-item:only-child { max-height: 260px; }
/* 拖拽排序交互反馈 */
.compose-media-item { cursor: grab; }
.compose-media-item:active { cursor: grabbing; }
.compose-media-item.dragging { opacity: .4; }
.compose-media-item.drop-before { box-shadow: -3px 0 0 0 #1d9bf0; }
.compose-media-item.drop-after { box-shadow: 3px 0 0 0 #1d9bf0; }
.compose-media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.compose-media-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-badge-gif {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}
/* 视频预览角标（发布框） */
.media-badge-play {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,.65);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    pointer-events: none;
}
.media-badge-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    pointer-events: none;
}

/* -- 工具栏按钮 -- */
.compose-tool-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.compose-tool-btn:hover { background: rgba(29,155,240,.1); }

/* 草稿箱入口按钮的角标（草稿数量） */
.draft-open-btn { position: relative; }
.draft-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--accent, #1d9bf0);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
}

/* 草稿箱浮层 */
.draft-panel {
    position: fixed;
    inset: 0;
    /* 必须高于发帖模态框（.modal 的 z-index:1100），
       否则在发帖窗口已打开时点“草稿”会看不到草稿浮层，需先关闭发帖窗口 */
    z-index: 1200;
    display: none;
}
.draft-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}
.draft-panel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 92vw);
    max-height: 80vh;
    background: var(--bg-elevated, #fff);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.draft-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color, #eff3f4);
}
.draft-panel-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.draft-panel-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    width: 34px;
    height: 34px;
}
.draft-panel-close:hover { background: rgba(0,0,0,.06); }
.draft-panel-list {
    padding: 8px;
    overflow-y: auto;
}
.draft-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 36px 12px;
    font-size: 14px;
}
.draft-item {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s;
}
.draft-item:hover { background: var(--hover-bg, #f7f9f9); }
.draft-item-main { flex: 1; min-width: 0; }
.draft-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.draft-item-preview {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.draft-item-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.draft-item-ctx { font-weight: 600; }
.draft-tag {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(29,155,240,.12);
    color: var(--accent, #1d9bf0);
}
.draft-item-time { margin-left: auto; }
.draft-item-actions {
    display: flex;
    align-items: center;
}
.draft-del-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 8px;
    line-height: 1;
}
.draft-del-btn:hover { background: rgba(244,33,46,.12); }

/* -- 添加网络图片链接输入框 -- */
.compose-image-url-box {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    order: 5;
    padding: 0 4px;
}
.compose-image-url-input {
    flex: 1;
    min-width: 0;
    background: var(--bg-secondary, #202327);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 14px;
    outline: none;
}
.compose-image-url-input:focus {
    border-color: var(--accent, #1d9bf0);
}
.compose-image-url-input::placeholder {
    color: var(--text-secondary);
}

/* ============================================ */
/* Emoji 选择器                                 */
/* ============================================ */
.emoji-picker {
    padding: 8px 12px 0;
    margin-bottom: 8px;
    border-top: 1px solid var(--border-color);
}
.emoji-cats {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}
.emoji-cat {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.emoji-cat:hover { background: var(--bg-hover); }
.emoji-cat.active {
    background: rgb(29,155,240);
    color: #fff;
}
.emoji-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}
.emoji-item {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.emoji-item:hover { background: var(--bg-hover); }

/* 私信表情面板：浮在输入框上方，避免撑高输入栏 */
.dm-emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-width: calc(100vw - 24px);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.25);
    padding: 8px;
    margin-bottom: 0;
    border-top: 1px solid var(--border-color);
    z-index: 20;
}
.dm-emoji-picker .emoji-list { max-height: 160px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dm-emoji-picker .emoji-item { touch-action: manipulation; }

/* ============================================ */
/* 投票编辑器                                  */
/* ============================================ */
.compose-poll-builder {
    padding: 12px;
    margin: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
}
.poll-builder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.poll-question-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 15px;
    padding: 8px 0;
    outline: none;
}
.poll-question-input:focus { border-color: var(--accent); }
.poll-question-input::placeholder { color: var(--text-secondary); }

.poll-option-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}
.poll-option-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
}
.poll-option-input:focus { border-color: var(--accent); }
.poll-option-input::placeholder { color: var(--text-secondary); }

.poll-opt-remove {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}
.poll-opt-remove:hover { color: var(--danger); background: rgba(244,33,46,.1); }

.poll-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.poll-add-option {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background: rgba(29,155,240,.1);
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
}
.poll-add-option:hover { background: rgba(29,155,240,.2); }
.poll-duration-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}
.poll-remove-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--danger);
    font-size: 13px;
    cursor: pointer;
}
.poll-remove-btn:hover { background: rgba(244,33,46,.1); }

/* ============================================ */
/* 帖子图片画廊                                */
/* ============================================ */
.post-media-gallery {
    margin-top: 10px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: grid;
    gap: 2px;
    background: var(--bg-elevated);
    position: relative;
}
/* 多图：正方形缩略图网格（X.com 风格） */
.gallery-1 { grid-template-columns: 1fr; }
.gallery-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-4 { grid-template-columns: repeat(2, 1fr); }
/* 3、5~9 张：均为 3 列正方形网格（X.com 上限 4，此处扩展至 9） */
.gallery-5,
.gallery-6,
.gallery-7,
.gallery-8,
.gallery-9 { grid-template-columns: repeat(3, 1fr); }

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
/* 多图缩略图强制正方形，与 X.com 一致 */
.post-media-gallery:not(.gallery-1) .gallery-item {
    aspect-ratio: 1 / 1;
}
.gallery-img, .gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 单图：保持原始比例，限制最大高度（X.com 单图不裁切） */
.gallery-1 .gallery-item {
    max-height: 510px;
    aspect-ratio: auto;
}
.gallery-1 .gallery-img,
.gallery-1 .gallery-media {
    object-fit: contain;
    background: var(--bg-elevated);
    /* 单图：使用图片原始尺寸，不强行放大；小图保持原样，大图受 max-width/max-height 限制 */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 510px;
}
.gallery-item.has-overflow { overflow: hidden; }
/* 图片序号指示器（X.com 风格：右上角 "当前 / 总数" 胶囊，浮于图上）。
   首页与个人主页的时间线不显示该页码，仅帖子详情页保留 */
body[data-page="home"] .gallery-counter,
body[data-page="profile"] .gallery-counter {
    display: none;
}
.gallery-counter {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    padding: 2px 10px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: .3px;
    pointer-events: none;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    font-variant-numeric: tabular-nums;
}
/* 桌面端大图顶到视口最顶时，序号胶囊随图片出血到视口右上角 */
@media (min-width: 701px) {
    .post-detail-main .post-card:not(.is-private) .gallery-counter {
        top: calc(var(--detail-top-offset, 53px) + 8px);
        right: max(8px, calc(50vw - 50% + 8px));
    }
}
.gallery-overflow-text {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gif-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    pointer-events: none;
}
/* 视频播放覆盖层 + 时长角标 */
.media-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0,0,0,.15);
}
.media-play-overlay svg {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
    opacity: .92;
}
.media-duration-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    pointer-events: none;
    z-index: 2;
}

/* ============================================================ */
/* 移动端帖子详情「小红书化」沉浸式改造（仅 ≤760px 生效）       */
/* ============================================================ */
@media (max-width: 760px) {
    :root { --post-pad: 16px; }

    /* 卡片去边界，内容贴边沉浸 */
    .post-detail .post-card {
        margin: 0 !important;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        padding: var(--post-pad);
    }

    /* 媒体满宽出血：贴到屏幕左右边缘，沉浸阅读 */
    .post-detail .post-media-gallery,
    .post-detail .gallery-1 .gallery-item,
    .post-detail .single-media,
    .post-detail .post-video {
        border-radius: 0;
    }
    .post-detail .post-media-gallery,
    .post-detail .single-media {
        margin-left: calc(-1 * var(--post-pad));
        margin-right: calc(-1 * var(--post-pad));
        width: auto;
    }
    .post-detail .post-media-gallery { margin-top: 0; }

    /* 单图：小红书式竖图 3:4，cover 填满，更抓眼 */
    .post-detail .gallery-1 .gallery-item {
        max-height: none;
        aspect-ratio: 3 / 4;
        background: #000;
        overflow: hidden;
    }
    .post-detail .gallery-1 .gallery-img,
    .post-detail .gallery-1 .gallery-media {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: cover;
        background: #000;
    }

    /* 多图：3 列正方形网格（小红书九宫格观感），紧凑圆角 */
    .post-detail .gallery-2,
    .post-detail .gallery-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    .post-detail .gallery-5,
    .post-detail .gallery-6,
    .post-detail .gallery-7,
    .post-detail .gallery-8,
    .post-detail .gallery-9 { gap: 3px; }
    .post-detail .post-media-gallery .gallery-item { border-radius: 6px; }

    /* 视频：满宽，高度自适应 */
    .post-detail .post-video { max-height: 80vh; }

    /* 字体层级（年轻化、舒适阅读） */
    .post-detail .post-title {
        font-size: 19px;
        line-height: 1.42;
        font-weight: 700;
        letter-spacing: .2px;
        margin: 16px 0 10px;
    }
    .post-detail .post-content {
        font-size: 16px;
        line-height: 1.78;
        color: #222;
        margin: 4px 0 16px;
        word-break: break-word;
    }
    .post-detail .post-content .hashtag { font-weight: 600; }

    /* 作者信息精致化 */
    .post-detail .post-display-name { font-size: 15px; font-weight: 600; }
    .post-detail .post-username { font-size: 13px; }
    .post-detail .post-time { font-size: 12px; color: var(--text-secondary); }
    .post-detail .post-follow-btn {
        padding: 6px 18px;
        font-size: 13px;
        border-radius: 999px;
    }

    /* 正文底部留出吸底栏空间，避免内容被遮挡 */
    .post-detail .comments-section-detail { padding-bottom: 88px; }

    /* ---------- 底部互动栏重构：移动端固定吸底栏 ---------- */
    /* 隐藏详情内原行内互动栏（桌面 X 风格），改用吸底栏 */
    .post-detail .post-actions { display: none; }
    .post-actions-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: flex;
        align-items: center;
        justify-content: space-around;
        height: 56px;
        padding: 0 8px calc(env(safe-area-inset-bottom, 0px));
        background: rgba(255,255,255,.96);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
        border-top: 1px solid var(--border-color, #eee);
        box-shadow: 0 -2px 12px rgba(0,0,0,.05);
    }
    .post-actions-bar .bar-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: 0;
        background: transparent;
        color: #333;
        font-size: 11px;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform .12s ease;
        padding: 4px 0;
    }
    .post-actions-bar .bar-btn:active { transform: scale(.86); }
    .post-actions-bar .bar-btn svg { width: 24px; height: 24px; }
    .post-actions-bar .bar-count { font-size: 11px; color: #666; font-variant-numeric: tabular-nums; }
    .post-actions-bar .bar-btn.active.like-btn { color: #ff2e4d; }
    .post-actions-bar .bar-btn.active.like-btn .bar-count { color: #ff2e4d; }
    .post-actions-bar .bar-btn.active.like-btn svg { fill: #ff2e4d; stroke: #ff2e4d; }
    .post-actions-bar .bar-btn.active.bookmark-btn { color: #ff9500; }
    .post-actions-bar .bar-btn.active.bookmark-btn .bar-count { color: #ff9500; }
    .post-actions-bar .bar-btn.active.bookmark-btn svg { fill: #ff9500; stroke: #ff9500; }
    /* 点赞弹跳动效 */
    @keyframes barPop { 0% { transform: scale(1);} 40% { transform: scale(1.35);} 100% { transform: scale(1);} }
    .post-actions-bar .bar-btn.pop svg { animation: barPop .32s ease; }
}

/* ============================================ */
/* 图片查看器 lightbox（X.com 风格）            */
/* ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.92);
    -webkit-tap-highlight-color: transparent;
}
/* X.com 媒体查看器：左侧媒体 + 右侧回复面板 */
.lightbox.has-side {
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    background: rgba(0,0,0,.92);
}
.lightbox.has-side .lightbox-stage {
    flex: 1 1 auto;
    max-width: none;
    width: calc(100% - 420px);
    height: 100vh;
    height: 100dvh;
    background: rgba(0,0,0,.92);
    /* 顶部/底部边距清零，使图片与浏览器窗口顶部无缝贴合（垂直间距为 0） */
    padding: 0 24px;
    display: flex;
    /* 图片从顶部开始排布，确保顶部无缝贴合窗口 */
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
.lightbox.has-side .lightbox-nav.lightbox-prev { left: 16px; }
.lightbox.has-side .lightbox-nav.lightbox-next { left: calc(100% - 420px - 64px); }
.lightbox-stage {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    /* 图片从顶部对齐，使顶部与窗口边缘无缝贴合（垂直间距为 0） */
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
/* 全屏模式（无右侧互动评论面板）：图片/视频占满整个屏幕，沉浸显示 */
.lightbox:not(.has-side) .lightbox-stage {
    max-width: 100vw;
    max-width: 100dvw;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 0;
}
.lightbox:not(.has-side) .lightbox-media {
    border-radius: 0;
    box-shadow: none;
}
.lightbox-media {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 40px rgba(0,0,0,.6);
    user-select: none;
    /* 智能自适应过渡：窗口缩放 / 全屏切换 / 放大还原 / 卡片→幻灯片 时平滑变化 */
    transition: opacity .28s ease, transform .28s ease, max-width .2s ease, max-height .2s ease;
    will-change: transform;
    opacity: 0;
}
/* 视频：在 stage 内以 contain 完整显示且不溢出；用 width:100% 让 object-fit 正确
   作用于视频固有分辨率（避免竖屏/大尺寸视频撑破容器导致不居中或溢出） */
.lightbox-media[data-type="video"] {
    width: 100%;
    height: 100%;
    background: #000;
    cursor: pointer;
}
/* 图片加载完成：淡入显示，避免冷加载白块闪现 */
.lightbox-media.ready {
    opacity: 1;
}
/* 单图：保持原始比例（contain），不强行裁切，与卡片预览的 3:4 cover 形成平滑放大过渡 */
.lightbox:not(.has-side) .gallery-1 .lightbox-media,
.lightbox-media {
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s;
    z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
    z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,.28); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 999px;
    z-index: 2;
}
.lightbox.has-side .lightbox-counter {
    right: auto;
    left: calc(50% - 210px);
    transform: translateX(-50%);
}

/* 图片下方操作栏（仅 PC 端显示，与帖子详情页一致的 回复/转发/喜欢/书签）：
   悬浮于图片底部中央，半透明胶囊，深色舞台适配 */
.lightbox-under-actions {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 6;
    display: none;
}
.lightbox.has-side .lightbox-under-actions {
    left: 0;
    width: calc(100% - 420px);
    transform: none;
    justify-content: center;
}
@media (min-width: 701px) {
    .lightbox-under-actions { display: flex; }
    .lightbox-under-actions .post-actions {
        justify-content: center;
        gap: 2px;
        padding: 5px 14px;
        border-radius: 999px;
        background: rgba(10, 14, 20, .55);
        border: 1px solid rgba(255, 255, 255, .14);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
    }
    .lightbox-under-actions .action-btn { color: #fff; }
    .lightbox-under-actions .action-btn:hover {
        color: var(--accent);
        background: rgba(29, 155, 240, .16);
    }
    .lightbox-under-actions .like-btn:hover,
    .lightbox-under-actions .like-btn.liked {
        color: var(--like-color);
        background: rgba(249, 24, 128, .16);
    }
    .lightbox-under-actions .repost-btn:hover,
    .lightbox-under-actions .repost-btn.reposted,
    .lightbox-under-actions .repost-caret:hover {
        color: var(--repost-color);
        background: rgba(0, 186, 124, .16);
    }
    .lightbox-under-actions .bookmark-btn:hover,
    .lightbox-under-actions .bookmark-btn.bookmarked {
        color: var(--accent);
        background: rgba(29, 155, 240, .16);
    }
    /* 深色舞台下的转发菜单与悬停气泡 */
    .lightbox-under-actions .repost-menu {
        background: #15202b;
        color: #f7f9f9;
    }
    .lightbox-under-actions .repost-menu .menu-item { color: #f7f9f9; }
    .lightbox-under-actions .repost-menu .menu-item:hover { background: rgba(255, 255, 255, .08); }
    .lightbox-under-actions .action-btn[data-tooltip] {
        --bg-elevated: #15202b;
        --text-primary: #f7f9f9;
    }
}

/* 右上角折叠开关：在“全屏图片”与“显示互动评论信息”之间切换 */
.lightbox-expand {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,20,25,.75);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    cursor: pointer;
    z-index: 3;
    padding: 0;
    transition: background .2s, transform .15s;
}
.lightbox-expand:hover {
    background: rgba(39,44,48,.95);
    transform: scale(1.06);
}
.lightbox-expand:active { transform: scale(.94); }
.lightbox-expand svg { display: block; }
.lightbox-expand .icon-collapse { display: none; }
/* 没有可加载的帖子信息面板时（如纯媒体网格无 postId）隐藏开关 */
.lightbox.no-side .lightbox-expand { display: none; }
/* 全屏态（无信息面板）时，计数器右移，避免与开关重叠 */
.lightbox:not(.has-side):not(.no-side) .lightbox-counter {
    right: 64px;
}

/* ===== lightbox 右侧回复面板（X.com 媒体查看器风格）===== */
.lightbox-side {
    flex: 0 0 420px;
    width: 420px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}
.lightbox-side-head {
    padding: 12px 16px 4px;
    flex: 0 0 auto;
    max-height: 45vh;
    overflow-y: auto;
}
.lightbox-side-post {
    display: flex;
    gap: 12px;
    align-items: center;
}
.lightbox-side-meta { min-width: 0; flex: 1 1 auto; }
.lightbox-side-name {
    display: inline-block;
    vertical-align: bottom;
    max-width: 72%;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lightbox-side-handle { font-weight: 400; color: var(--text-secondary); font-size: 15px; white-space: nowrap; }
.lightbox-side-text {
    padding: 12px 16px;
    font-size: 17px;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    border-bottom: 1px solid var(--border-color);
}
.lightbox-side-stats {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}
.lightbox-side-stats .stat-item b {
    color: var(--text-primary);
    font-weight: 700;
}
.lightbox-side-views {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

/* 帖子操作工具栏（X.com 媒体查看器：回复/转发/喜欢/书签/分享） */
.lightbox-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-color);
}
.lightbox-post-actions .lb-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 999px;
    font-size: 13px;
    transition: color .2s, background .2s;
}
.lightbox-post-actions .lb-action svg { display: block; }
.lightbox-post-actions .lb-reply:hover { color: var(--accent-color); background: rgba(29,155,240,.1); }
.lightbox-post-actions .lb-repost:hover { color: #00ba7c; background: rgba(0,186,124,.1); }
.lightbox-post-actions .lb-like:hover { color: #f91880; background: rgba(249,24,128,.1); }
.lightbox-post-actions .lb-like.liked { color: #f91880; }
.lightbox-post-actions .lb-bookmark:hover { color: var(--accent-color); background: rgba(29,155,240,.1); }
.lightbox-post-actions .lb-bookmark.bookmarked { color: var(--accent-color); }
.lightbox-post-actions .lb-share:hover { color: var(--accent-color); background: rgba(29,155,240,.1); }
.lightbox-post-actions .lb-count { font-size: 13px; }
.lightbox-comments {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0;
}
.lightbox-comment-row {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.lightbox-comment-body { min-width: 0; flex: 1 1 auto; }
.lightbox-comment-meta { font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lightbox-comment-name { font-weight: 700; }
.lightbox-comment-handle { font-weight: 400; color: var(--text-secondary); }
.lightbox-comment-text {
    margin-top: 2px;
    font-size: 15px;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}
.lightbox-comment-edited {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 13px;
}
.lightbox-comment-menu {
    position: relative;
    margin-left: auto;
}
.lightbox-comment-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 9999px;
}
.lightbox-comment-btn:hover { background: var(--hover-bg); color: var(--accent); }
.lightbox-comment-menu-list {
    display: none;
    position: absolute;
    right: 0;
    top: 28px;
    z-index: 30;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    min-width: 120px;
    overflow: hidden;
}
.lightbox-comment-menu.open .lightbox-comment-menu-list { display: block; }
.lightbox-comment-menu-list button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}
.lightbox-comment-menu-list button:hover { background: var(--hover-bg); }
.lightbox-comment-menu-list button.danger { color: #f4212e; }
.lightbox-reply-box {
    padding: 12px 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}
.lightbox-reply-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lightbox-reply-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.lightbox-reply-input {
    flex: 1 1 auto;
    resize: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    max-height: 160px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 11px 13px;
    font: inherit;
    font-size: 15px;
    outline: none;
    line-height: 1.4;
}
.lightbox-reply-input:focus { border-color: var(--accent-color); }
.lightbox-reply-form .btn,
.lightbox-reply-box .post-reply-form .btn { flex: 0 0 auto; align-self: flex-end; }
.lightbox-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.lightbox-reply-bar .compose-tools { margin: 0; }
.lightbox-reply-row .avatar-sm { flex: 0 0 auto; margin-top: 2px; }

/* 回帖框媒体预览（复用发帖预览样式） */
.reply-media-preview {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 0;
}
.reply-media-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--bg-secondary);
}
.reply-media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.reply-media-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 9999px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

/* 回帖框表情面板 */
.reply-emoji-picker {
    position: relative;
    margin-top: 4px;
}
.reply-emoji-picker .emoji-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    max-height: 180px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
}
.reply-emoji-picker .emoji-item {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    padding: 2px;
}
.reply-emoji-picker .emoji-item:hover { background: var(--hover-bg); }

/* 幻灯片侧栏底部回复框：表情面板向上浮出，避免被侧栏 overflow:hidden 裁切 */
.lightbox-reply-box { position: relative; }
[id^="lb-comment-emoji-"].reply-emoji-picker {
    position: absolute;
    right: 12px;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
    z-index: 20;
    width: min(320px, calc(100% - 24px));
}
[id^="lb-comment-emoji-"].reply-emoji-picker .emoji-list {
    grid-template-columns: repeat(7, 1fr);
    max-height: 168px;
}

/* 评论中的媒体画廊 */
.comment-media-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.comment-media-item {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-secondary);
    overflow: hidden;
}
.comment-media-item img,
.comment-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.comment-media-item:only-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
}

/* 移动端：右侧面板堆叠到媒体下方 */
@media (max-width: 760px) {
    /* 手机端：帖子内图片/视频满屏显示，左右边框与屏幕左右边框对齐。
       （700px 以下同时匹配上面的 max-width:700 块，此处统一用 -62px 保持一致。） */
    .post-card .post-media-gallery {
        width: 100vw;
        margin-left: -62px;
        margin-right: 0;
    }
    /* 引用帖内的嵌套画廊保持内嵌缩进，不参与满屏出血 */
    .quoted-post .post-media-gallery,
    .quoted-post .post-media-gallery.gallery-slider {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    /* 详情页（/post/xxx）主帖画廊：移动端在卡片内自适应铺满（稳妥方案，杜绝 100vw + 负 margin 越界遮挡）。
       桌面端(≥701px)的满屏出血逻辑不受影响。 */
    .post-detail-main .post-card .post-media-gallery,
    .post-detail-main .post-card .post-media-gallery.gallery-slider,
    .post-detail-main .post-card .post-image {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        border-radius: var(--radius);
        overflow: hidden;
    }
    .post-detail-main .post-card .post-media-gallery img,
    .post-detail-main .post-card .post-media-gallery video,
    .post-detail-main .post-card .post-image img,
    .post-detail-main .post-card .post-image video {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
    }
    .lightbox { -webkit-overflow-scrolling: touch; touch-action: manipulation; }
    /* 纯幻灯片：全屏沉浸，图片占满视口 */
    .lightbox .lightbox-stage { max-width: 100vw; max-height: 100vh; padding: 0; }
    .lightbox .lightbox-media  { border-radius: 0; }
    /* 带侧栏：媒体在上、回复面板在下，整体可纵向滚动 */
    .lightbox.has-side { flex-direction: column; overflow-y: auto; }
    .lightbox.has-side .lightbox-stage {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        height: 50vh;
        padding: 8px;
        box-sizing: border-box;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
    }
    /* 导航按钮移到图片区域左右两侧中部，避免盖住文字 */
    .lightbox.has-side .lightbox-nav.lightbox-prev { left: 10px; right: auto; top: 25vh; }
    .lightbox.has-side .lightbox-nav.lightbox-next { left: auto; right: 10px; top: 25vh; }
    .lightbox.has-side .lightbox-counter {
        top: 12px; left: 50%; right: auto; transform: translateX(-50%);
    }
    /* 移动端关闭按钮：加大命中区、加白色描边与阴影，确保在浅色图片上也清晰可见 */
    .lightbox-close {
        top: 14px; left: 14px;
        width: 44px; height: 44px;
        background: rgba(0,0,0,.55);
        border: 2px solid rgba(255,255,255,.92);
        box-shadow: 0 2px 10px rgba(0,0,0,.45);
        font-size: 26px;
    }
    .lightbox-close:hover { background: rgba(0,0,0,.7); }
    .lightbox-side {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-height: 50vh;
        height: auto;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    .lightbox-side-head {
        max-height: none;
        overflow-y: visible;
    }

    /* 移动端：多图改为小红书 App 式横向滑动整图轮播；桌面端仍为 X.com 宫格 */
    .post-media-gallery.gallery-slider {
        display: flex !important;
        grid-template-columns: none;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        /* 满屏显示，左右边框与屏幕左右边框对齐 */
        margin-left: -62px;
        margin-right: 0;
        width: 100vw;
    }
    .post-media-gallery.gallery-slider::-webkit-scrollbar { display: none; }
    .post-media-gallery.gallery-slider .gallery-item {
        flex: 0 0 100%;
        width: 100%;
        aspect-ratio: 4 / 5;          /* 接近小红书竖图比例，整图可见 */
        scroll-snap-align: center;
        border-radius: 0;
    }
    .post-media-gallery.gallery-slider .gallery-item img,
    .post-media-gallery.gallery-slider .gallery-item video {
        object-fit: cover;
        border-radius: 0;
    }
    .post-media-gallery.gallery-slider .gallery-item.has-overflow .gallery-overflow-text {
        border-radius: 0;
    }
}

/* ============================================ */
/* 投票卡片                                    */
/* ============================================ */
.poll-card {
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--bg-secondary);
}
.poll-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.poll-option {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s, background .2s;
}
.poll-option:hover { border-color: var(--accent); background: rgba(29,155,240,.06); }
.poll-option.voted { border-color: var(--accent); }
.poll-option.leader { border-color: rgba(29,155,240,.4); background: rgba(29,155,240,.08); }

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(29,155,240,.15);
    transition: width .4s ease;
    border-radius: 5px 0 0 5px;
    z-index: 0;
}
.poll-option.voted .poll-option-bar { background: rgba(29,155,240,.25); }
.poll-option-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
}
.poll-option-text { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.poll-option-pct { font-size: 14px; color: var(--accent); font-weight: 700; }

.poll-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.poll-voted-mark { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 1100px) {
    .right-sidebar { display: none; }
    /* 中等屏幕收窄私信侧栏，避免对话区被挤压 */
    .dm-sidebar { width: 300px; }
}

@media (max-width: 700px) {
    .app { flex-direction: column; }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        /* 必须高于网盘内所有常驻/浮层元素（工具栏、预览弹层等），
           否则展开抽屉时网盘 UI 会盖在导航菜单之上造成重叠 */
        z-index: 1000;
        background: var(--bg-primary);
        transition: left .3s;
        box-shadow: none;
        width: var(--sidebar-width);
        align-items: stretch;
    }
    .sidebar.collapsed { width: var(--sidebar-width); }
    .sidebar.open { left: 0; box-shadow: 0 0 20px rgba(0,0,0,.5); }
    /* 抽屉遮罩：覆盖主内容，点击关闭；层级介于内容与侧边栏之间 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 999;
    }
    .sidebar-overlay:not([hidden]) { display: block; }
    body.sidebar-open { overflow: hidden; }
    .main-content { overflow-x: hidden; }
    .sidebar .nav-item span { display: inline; }
    .sidebar.collapsed .nav-item > span:not(.nav-icon) { display: inline; }
    .sidebar.collapsed .nav-item,
    .sidebar.collapsed .post-btn-wrapper,
    .sidebar.collapsed .sidebar-user { width: auto; padding: 12px 16px; justify-content: flex-start; gap: 16px; }
    .sidebar.collapsed .post-btn-wrapper .btn span.btn-label { display: inline; }
    .sidebar.collapsed .sidebar-user-info,
    .sidebar.collapsed .sidebar-logout,
    .sidebar.collapsed .theme-toggle-sidebar { display: flex; }
    .sidebar-collapse-btn { display: none; }
    .main-content {
        max-width: 100%;
        border-right: none;
        min-height: calc(100vh - 53px);
        min-height: calc(100dvh - 53px);
    }
    .mobile-header { display: flex; }
    /* 移动端 page-header 不再使用负边距，避免与 mobile-header 错位 */
    .page-container .page-header { margin: 0 0 12px; }
    .modal-content { border-radius: 0; max-height: 100vh; }
}

/* 中等屏幕（平板）：右侧栏隐藏后让主内容居中，避免左侧孤立 */
@media (min-width: 1101px) and (max-width: 1280px) {
    .app { justify-content: center; }
    .main-content { border-left: 1px solid var(--border-color); }
}

/* ============================================ */
/* 私信 / 消息 (DM)                              */
/* ============================================ */
.dm-container {
    display: flex;
    height: calc(100vh - 0px);
    height: calc(100dvh - 0px);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* 私信页面需要更宽的主内容区（默认 600px 会挤压对话区） */
.main-content--wide { max-width: 100%; }

.dm-sidebar {
    width: var(--dm-sidebar-width, 400px);
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width .2s ease;
}
/* 消息栏 / 对话窗之间的拖拽分隔条（桌面端可自由调节宽度；移动端隐藏） */
.dm-resizer {
    flex: 0 0 6px;
    cursor: col-resize;
    background: transparent;
    transition: background .15s;
    touch-action: none;
}
.dm-resizer:hover,
.dm-resizer.dm-resizing { background: var(--accent); }
/* 拖拽过程中关闭宽度过渡，避免卡顿 */
.dm-container.dm-resizing .dm-sidebar { transition: none; }
.dm-sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}
.dm-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 9999px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
.dm-collapse-btn:hover { background: var(--bg-hover); }
.dm-sidebar-header h1 { font-size: 20px; font-weight: 800; flex: 1; margin: 0; }
.dm-search { padding: 8px 12px; border-bottom: 1px solid var(--border-color); }
.dm-search input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 8px 16px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}
.dm-search input:focus { border-color: var(--accent); }

.dm-list { flex: 1; overflow-y: auto; }

/* 桌面端：收件箱收缩为图标条（对齐 x.com i/chat 的折叠效果） */
.dm-container.dm-collapsed .dm-sidebar { width: 88px; }
.dm-container.dm-collapsed .dm-sidebar-header { padding: 16px 8px; justify-content: center; gap: 0; }
.dm-container.dm-collapsed .dm-sidebar-header h1,
.dm-container.dm-collapsed .dm-search { display: none; }
.dm-container.dm-collapsed .dm-list .dm-item-link { padding: 12px 8px; justify-content: center; }
.dm-container.dm-collapsed .dm-list .dm-item-body { display: none; }
.dm-container.dm-collapsed .dm-list .dm-item-link .avatar-md {
    width: 48px; height: 48px; margin: 0 auto;
}
.dm-container.dm-collapsed .dm-list .dm-item-link .dm-mosaic.size-40 { width: 48px; height: 48px; }
.dm-loading, .dm-empty-state { padding: 24px 16px; color: var(--text-secondary); text-align: center; }

.dm-item { position: relative; border-bottom: 1px solid var(--border-color); transition: background .2s; }
.dm-item:hover { background: var(--bg-hover); }
.dm-item.active { background: var(--bg-secondary); }
.dm-item-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-primary); text-decoration: none; }
.dm-item-body { flex: 1; min-width: 0; }
.dm-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dm-item-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item-time { color: var(--text-secondary); font-size: 13px; flex-shrink: 0; }
.dm-item-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.dm-item-preview { color: var(--text-secondary); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.dm-you { color: var(--text-primary); }
.dm-item.unread .dm-item-name,
.dm-item.unread .dm-item-preview { color: var(--text-primary); font-weight: 700; }
.dm-item-unread {
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}

/* 微信风格：会话置顶 */
.dm-item.pinned { background: var(--bg-secondary); }
.dm-item.pinned:hover { background: var(--bg-hover); }
.dm-pin-badge { margin-right: 4px; font-size: 12px; line-height: 1; }
/* 条目右侧操作按钮（⋯）：默认隐藏，hover/聚焦/触摸时长按弹出菜单 */
.dm-item-action {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, background .15s, color .15s;
    flex-shrink: 0;
}
.dm-item:hover .dm-item-action,
.dm-item-action:focus-visible { opacity: 1; }
.dm-item-action:hover { background: var(--accent); color: #fff; }
/* 触摸设备：无 hover，按钮常显 */
@media (hover: none) {
    .dm-item-action { opacity: 1; }
    .dm-item .dm-item-link { padding-right: 44px; }
}
.dm-pin-divider {
    height: 8px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 0;
}
/* 会话条目操作（置顶）悬浮菜单 */
.dm-item-menu {
    position: fixed;
    z-index: 80;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.28);
    padding: 4px;
    min-width: 124px;
}
.dm-item-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
}
.dm-item-menu-item:hover { background: var(--bg-hover); color: var(--accent); }

/* ===== 群聊相关 ===== */
.dm-avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.dm-group-badge {
    position: absolute; right: -4px; bottom: -4px;
    font-size: 11px; line-height: 1;
    background: var(--bg-primary);
    border-radius: 999px; padding: 1px;
}
.dm-item-count { color: var(--text-secondary); font-weight: 400; font-size: 13px; margin-left: 4px; }
/* 群聊与私聊排版一致：不再显示发送者昵称行，身份识别靠头像 title 悬停 */
/* 微信风格群头像：成员头像拼图 */
.dm-mosaic {
    display: grid; gap: 1px; padding: 1px;
    background: #e8e8e8;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 0;
}
.dm-mosaic.size-40 { width: 40px; height: 40px; }
.dm-mosaic.size-52 { width: 52px; height: 52px; }
.dm-mosaic .dm-mosaic-cell,
.dm-mosaic .dm-mosaic-empty { width: 100%; height: 100%; display: block; }
.dm-mosaic .dm-mosaic-cell { object-fit: cover; }
.dm-mosaic .dm-mosaic-empty { background: #e2e2e2; }
.dm-mosaic .dm-mosaic-span { grid-row: span 2; }

/* 发起群聊 / 群信息 弹窗 */
.dm-modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90;
}
.dm-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 440px; max-width: 94vw; max-height: 86vh; overflow: auto;
    background: var(--bg-primary); border-radius: 14px; z-index: 95;
    box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column;
}
.dm-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid var(--border-color);
}
.dm-modal-head h3 { margin: 0; font-size: 16px; color: var(--text-primary); }
.dm-modal-close { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--text-secondary); line-height: 1; }
.dm-modal-close:hover { color: var(--accent); }
.dm-modal-body { padding: 16px 18px; }
.dm-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px 16px; }
.dm-field { margin-bottom: 14px; }
.dm-field > label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.dm-input {
    width: 100%; border: 1px solid var(--border-color); border-radius: 8px;
    padding: 9px 11px; font-size: 14px; color: var(--text-primary);
    background: var(--bg-primary); outline: none; box-sizing: border-box;
}
.dm-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,155,240,.12); }
.dm-btn {
    border: 1px solid var(--border-color); background: var(--bg-primary);
    color: var(--text-primary); border-radius: 9px; padding: 9px 16px;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.dm-btn:hover { background: var(--bg-hover); }
.dm-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dm-btn-primary:hover { filter: brightness(.95); }
.dm-btn-danger { color: #e0483b; border-color: #f0c4c0; }
.dm-btn-danger:hover { background: #fdecea; }

.dm-pick-list { max-height: 220px; overflow: auto; border: 1px solid var(--border-color); border-radius: 8px; margin-top: 6px; }
.dm-pick-hint { padding: 12px; color: var(--text-secondary); font-size: 13px; text-align: center; }
.dm-pick-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    cursor: pointer; border-bottom: 1px solid var(--border-color);
}
.dm-pick-item:last-child { border-bottom: none; }
.dm-pick-item:hover { background: var(--bg-hover); }
.dm-pick-item .avatar-sm { width: 28px; height: 28px; border-radius: 50%; }
.dm-pick-handle { color: var(--text-secondary); font-size: 12px; }
.dm-pick-check { margin-left: auto; color: var(--accent); font-weight: 700; }
.dm-pick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dm-chip {
    display: inline-flex; align-items: center; gap: 4px; background: var(--bg-secondary);
    border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--text-primary);
}
.dm-chip-x { border: none; background: none; cursor: pointer; color: var(--text-secondary); font-size: 14px; line-height: 1; }

/* 群信息 */
.dm-group-info-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dm-group-info-head .avatar-lg { width: 52px; height: 52px; border-radius: 12px; }
.dm-group-info-head .dm-group-info-avatar { display: inline-flex; flex-shrink: 0; }
.dm-group-info-head .dm-group-info-avatar .dm-mosaic { border-radius: 12px; }
.dm-group-info-name { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.dm-group-info-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.dm-group-notice { background: var(--bg-secondary); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.dm-group-notice-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.dm-group-notice-text { font-size: 13px; color: var(--text-primary); white-space: pre-wrap; }
.dm-group-members-title { font-size: 13px; color: var(--text-secondary); margin: 6px 0 8px; }
.dm-group-members {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px;
}
.dm-member { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.dm-member .avatar-md { width: 44px; height: 44px; border-radius: 10px; }
.dm-member-name { font-size: 11px; color: var(--text-primary); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-member-add { cursor: pointer; }
.dm-member-add-icon {
    width: 44px; height: 44px; border-radius: 10px; border: 1px dashed var(--border-color);
    display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-secondary);
}
.dm-member-add:hover .dm-member-add-icon { border-color: var(--accent); color: var(--accent); }
.dm-group-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

@media (max-width: 767px) {
    .dm-modal { width: 100%; max-width: 100%; max-height: 90vh; bottom: 0; top: auto; transform: none; border-radius: 16px 16px 0 0; }
}

/* 对话窗 */
.dm-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    position: relative;
}
.dm-empty {
    margin: auto;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}
.dm-empty-icon { margin-bottom: 16px; }
.dm-empty h2 { color: var(--text-primary); font-size: 24px; font-weight: 800; margin-bottom: 8px; }

.dm-thread-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.dm-thread-user { display: flex; align-items: center; gap: 12px; color: var(--text-primary); min-width: 0; }
.dm-thread-name { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-thread-handle { color: var(--text-secondary); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 移动端返回按钮：桌面端隐藏，仅窄屏显示 */
.dm-back {
    display: none;
    background: transparent; border: none; color: var(--text-primary);
    cursor: pointer; padding: 6px; margin-right: 4px; border-radius: 50%;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.dm-back:hover { background: var(--bg-hover); }

.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dm-bubble { display: flex; max-width: 100%; align-items: flex-end; gap: 8px; cursor: default; margin-bottom: 8px; }
.dm-bubble:last-child { margin-bottom: 0; }
.dm-bubble .dm-bubble-text, .dm-bubble .dm-bubble-media { user-select: text; }
.dm-bubble.mine { justify-content: flex-end; }
.dm-bubble.theirs { justify-content: flex-start; }
.dm-bubble.merged { margin-top: -4px; margin-bottom: 1px; }
.dm-bubble-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    flex-shrink: 0; align-self: flex-end; object-fit: cover;
    background: var(--bg-secondary);
}
/* 头像链接包裹层：保持与图片一致的 flex 行为，去除默认链接样式 */
.dm-avatar-link {
    display: block;
    flex-shrink: 0;
    align-self: flex-end;
    width: 30px; height: 30px;
    border-radius: 50%;
    overflow: hidden;
}
.dm-avatar-link .dm-bubble-avatar { display: block; }
.dm-bubble-inner {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.dm-bubble.mine .dm-bubble-inner { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.dm-bubble.theirs .dm-bubble-inner { background: var(--bg-secondary); color: var(--text-primary); border-bottom-left-radius: 4px; }
/* 纯图片气泡：去掉内层背景/padding，消除图片外圈蓝色边框，呈现无边框效果 */
.dm-bubble-inner.only-media { background: transparent !important; padding: 0 !important; box-shadow: none !important; }
.dm-bubble.mine .dm-bubble-inner.only-media { border-bottom-right-radius: 12px; }
.dm-bubble.theirs .dm-bubble-inner.only-media { border-bottom-left-radius: 12px; }
.dm-bubble-text { white-space: pre-wrap; }
.dm-bubble-media { max-width: min(320px, 72vw); max-height: min(320px, 60vh); width: auto; height: auto; border-radius: 12px; cursor: pointer; display: block; margin-top: 2px; object-fit: contain; background: var(--bg-secondary); }
.dm-bubble-time { font-size: 11px; opacity: .65; margin-top: 4px; text-align: right; }

/* 日期分隔条（微信风格） */
.dm-day-divider {
    display: flex;
    justify-content: center;
    margin: 18px 0 10px;
}
.dm-day-divider span {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 9999px;
}

/* 提醒标记 */
.dm-bubble.reminder .dm-bubble-inner { box-shadow: 0 0 0 2px #f5a623 inset; }
.dm-reminder-tag { font-size: 11px; color: #f5a623; margin-bottom: 4px; }

/* 引用块 */
.dm-quote {
    border-left: 3px solid var(--accent);
    background: rgba(29,155,240,.08);
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 4px;
}
.dm-quote-name { font-size: 12px; color: var(--accent); font-weight: 600; }
.dm-quote-text { font-size: 13px; color: var(--text-secondary); max-height: 40px; overflow: hidden; }
.dm-quote-inner { cursor: pointer; }

/* 对话区顶部按钮 / 搜索 / 引用条 */
.dm-header-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
}
.dm-header-btn:hover { background: var(--bg-hover); color: var(--accent); }
.dm-thread-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}
.dm-thread-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
}
.dm-thread-search-count { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.dm-search-nav { display: flex; gap: 4px; margin-right: 8px; }
.dm-search-nav button {
    width: 26px; height: 26px; border: none; border-radius: 6px;
    background: var(--bg-secondary); color: var(--text-primary);
    cursor: pointer; font-size: 14px; line-height: 1;
}
.dm-search-nav button:hover { background: var(--bg-hover); color: var(--accent); }
/* 会话内搜索结果下拉 */
.dm-search-result {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    margin-top: 6px;
    max-height: 50vh;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.28);
    z-index: 30;
    padding: 4px;
}
.dm-search-result-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.dm-search-result-item:hover { background: var(--bg-hover); }
.dm-search-result-item.dm-search-current { background: rgba(29,155,240,.16); }
.dm-search-empty { padding: 16px 10px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.dm-search-result-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.dm-search-result-body { min-width: 0; flex: 1; }
.dm-search-result-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.dm-search-result-text {
    font-size: 14px; color: var(--text-primary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.4;
}
/* 关键词高亮 */
.dm-search-result-text mark,
.dm-bubble-text mark {
    background: #ffe58a;
    color: #1a1a1a;
    border-radius: 3px;
    padding: 0 1px;
    font-weight: 600;
}
/* 命中消息气泡高亮 */
.dm-bubble.dm-search-hit {
    box-shadow: 0 0 0 2px var(--accent, #1d9bf0);
}
.dm-bubble.flash { animation: dmFlash 1.2s ease; }
@keyframes dmFlash {
    0% { background: rgba(29,155,240,.35); }
    100% { background: transparent; }
}
/* 会话列表中“相关聊天”标记（位于昵称下方，与昵称左对齐） */
.dm-item-match {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--accent, #1d9bf0);
    text-align: left;
}
/* 聊天区长按不触发系统文本选择（移动端），但图片允许原生「保存图片」菜单 */
.dm-messages { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dm-messages .dm-bubble-text, .dm-messages .dm-bubble-text * { -webkit-user-select: text; user-select: text; }
.dm-messages .dm-bubble-media { -webkit-user-select: auto; user-select: auto; -webkit-touch-callout: default; }
.dm-quote-bar {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.dm-quote-preview { display: flex; align-items: center; gap: 8px; }
.dm-quote-preview-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 新消息浮动提示：用户不在底部时出现在气泡区底部中央 */
.dm-newmsg-pill {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%) translateY(12px);
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 30;
}
.dm-newmsg-pill.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.dm-newmsg-pill:hover { filter: brightness(1.05); }
.dm-quote-close {
    background: transparent; border: none; color: var(--text-secondary);
    font-size: 20px; cursor: pointer; line-height: 1;
}

/* 搜索高亮 / 选中 / 闪烁 */
.dm-bubble.dm-search-hit .dm-bubble-inner { outline: 2px solid var(--accent); }
.dm-bubble.dm-search-current .dm-bubble-inner { outline: 2px solid var(--accent); background: var(--accent); color: #fff; }
.dm-bubble.selected .dm-bubble-inner { box-shadow: 0 0 0 2px var(--accent) inset; }
.dm-bubble.flash .dm-bubble-inner { animation: dmFlash .6s ease 2; }
@keyframes dmFlash { 0%,100% { background: var(--bg-secondary); } 50% { background: var(--accent); } }

/* 右键/长按菜单（微信风格：两行横排） */
.dm-ctx-menu {
    position: fixed;
    z-index: 1000;
    background: #ededed;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dm-ctx-row {
    display: flex;
    flex-direction: row;
    gap: 2px;
}
.dm-ctx-item {
    flex: 1 1 0;
    min-width: 66px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 16px;
    line-height: 1;
    color: #1a1a1a;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.dm-ctx-item:hover { background: rgba(0,0,0,.06); }
.dm-ctx-item.danger { color: #f4212e; }

/* 群聊 @提及 高亮 */
.dm-bubble-text .dm-mention { color: #136ce9; font-weight: 500; }

/* 群聊被 @提及 标记 */
.dm-mentioned-tag {
    display: inline-block;
    font-size: 10px;
    line-height: 1.6;
    padding: 0 5px;
    margin-bottom: 3px;
    color: #136ce9;
    background: rgba(19,108,233,.08);
    border-radius: 4px;
}

/* 群消息撤回提示 */
.dm-bubble.revoked .dm-bubble-inner,
.dm-bubble.revoked { background: transparent !important; box-shadow: none !important; border-radius: 0; }
.dm-bubble.revoked .dm-revoked {
    font-size: 12px;
    color: var(--text-secondary, #999);
    padding: 4px 0;
}

/* 输入框 @候选面板 */
.dm-mention-panel {
    position: absolute;
    bottom: 100%;
    left: 8px;
    width: min(320px, calc(100% - 16px));
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
    z-index: 50;
    padding: 6px;
}
.dm-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.dm-mention-item:hover { background: rgba(0,0,0,.05); }
.dm-mention-avatar {
    width: 30px; height: 30px;
    flex: 0 0 30px;
    display: flex; align-items: center; justify-content: center;
    background: #136ce9; color: #fff;
    font-size: 14px; border-radius: 50%;
    overflow: hidden;
}
.dm-mention-name { flex: 1; font-size: 14px; color: var(--text-primary, #1a1a1a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-mention-uname { font-size: 12px; color: var(--text-secondary, #999); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-mention-badge {
    font-size: 10px; line-height: 1;
    padding: 2px 5px; border-radius: 4px;
    color: #fff; background: #f5a623;
    flex: 0 0 auto;
}

/* 输入框 @所有人 按钮 */
.dm-atall-btn { font-size: 17px; font-weight: 600; color: var(--accent, #136ce9); }
.dm-atall-btn:hover { color: var(--accent, #136ce9); }

/* 群成员角色徽章 */
.dm-member-role-badge {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: 1px;
    color: #fff;
}
.dm-member-role-badge.owner { background: #f5a623; }
.dm-member-role-badge.admin { background: #136ce9; }
.dm-member.clickable { cursor: pointer; }
.dm-member.clickable:hover { background: rgba(0,0,0,.05); }

/* 成员管理菜单 */
.dm-member-menu {
    position: fixed;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    padding: 6px;
    min-width: 140px;
    z-index: 12000;
}
.dm-member-menu-title {
    font-size: 12px;
    color: var(--text-secondary, #999);
    padding: 6px 12px 8px;
    border-bottom: 1px solid var(--border-color, #eee);
    margin-bottom: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dm-member-menu .dm-ctx-item {
    justify-content: flex-start;
    padding: 0 12px;
    min-width: 120px;
    width: 100%;
}

/* 多选栏 */
.dm-multi-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    z-index: 1000;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
}
.dm-multi-left { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-primary); }
.dm-multi-actions { display: flex; gap: 8px; }
.dm-multi-actions button, .dm-multi-cancel {
    border: none; border-radius: 8px; padding: 8px 12px; font-size: 14px; cursor: pointer;
    background: var(--bg-secondary); color: var(--text-primary);
}
.dm-multi-actions button.danger { background: #f4212e; color: #fff; }
.dm-multi-cancel { background: transparent; color: var(--accent); }

/* 弹层（收藏 / 转发） */
.dm-modal-mask {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
}
/* 防御：带 hidden 的弹层/弹窗必须隐藏（部分浏览器 [hidden] UA 样式不含 !important，
   会被 .dm-modal{display:flex} 等覆盖，导致弹窗常驻页面且无法关闭） */
.dm-modal[hidden], .dm-modal-mask[hidden] { display: none !important; }
/* 群聊弹窗：遮罩与弹窗是兄弟节点（弹窗未包在遮罩内），遮罩 z-index(1100)
   不得高于弹窗(95)，否则空遮罩盖住弹窗，点击「发起群聊 / 群聊信息 / 添加成员」时只剩灰屏 */
#dm-create-group-mask, #dm-group-info-mask, #dm-gi-add-mask { z-index: 90; }
.dm-modal {
    width: 360px; max-width: calc(100vw - 32px);
    max-height: 70vh;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.dm-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border-color);
    font-weight: 700; color: var(--text-primary);
}
.dm-modal-close { background: transparent; border: none; color: var(--text-secondary); font-size: 22px; cursor: pointer; line-height: 1; }
.dm-modal-body { padding: 8px; overflow-y: auto; }
.dm-fwd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text-primary);
}
.dm-fwd-item:hover { background: var(--bg-hover); }
.dm-fav-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.dm-fav-body { flex: 1; min-width: 0; }
.dm-fav-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.dm-fav-text { font-size: 14px; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.dm-fav-del {
    flex-shrink: 0;
    width: 24px; height: 24px; border-radius: 50%;
    border: none; background: var(--bg-secondary); color: var(--text-secondary);
    font-size: 16px; line-height: 1; cursor: pointer; transition: background .2s, color .2s;
}
.dm-fav-del:hover { background: #f33a3a; color: #fff; }

/* Toast */
.dm-toast {
    position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(10px);
    background: rgba(0,0,0,.85); color: #fff; padding: 8px 16px; border-radius: 9999px;
    font-size: 14px; z-index: 1200; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}

.dm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.dm-translated { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-style: italic; }

/* 撰写区 */
.dm-compose { border-top: 1px solid var(--border-color); padding: 12px 16px; flex-shrink: 0; position: relative; }
.dm-compose-form { display: flex; align-items: flex-end; gap: 8px; position: relative; }
.dm-attach-btn, .dm-send-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dm-attach-btn:hover, .dm-send-btn:hover { background: rgba(29,155,240,.1); }
.dm-attach-btn, .dm-send-btn, .dm-action, #dm-emoji-btn { touch-action: manipulation; }
.dm-attach-btn:active, .dm-send-btn:active, .dm-action:active, #dm-emoji-btn:active { transform: scale(.92); }
.dm-input { touch-action: manipulation; }
.dm-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    outline: none;
    min-height: 40px;
    max-height: 140px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.4;
}
.dm-input:focus { border-color: var(--accent); }
.dm-send-btn { color: var(--accent); }
.dm-send-btn:disabled { opacity: .5; cursor: default; }

.dm-compose-media { margin-bottom: 8px; }
.dm-compose-media-item { position: relative; display: inline-block; }
.dm-compose-media-item img { max-width: 120px; max-height: 120px; border-radius: 12px; }
.dm-media-remove {
    position: absolute; top: -6px; right: -6px;
    background: rgba(0,0,0,.7); color: #fff; border: none;
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1;
}

/* 导航 badge 统一由 .nav-item .badge 控制（消息未读 #dm-badge 亦复用同一套定位，确保与通知 badge 对齐） */

/* 帖子卡片头像 hover 发消息按钮 */
.avatar-hover-card {
    position: absolute;
    top: 2px;
    right: 2px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .15s, transform .15s;
    z-index: 5;
}
.post-avatar:hover .avatar-hover-card { opacity: 1; transform: translateY(0); }
.avatar-dm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.avatar-dm-btn:hover { background: var(--accent-hover); }
.post-avatar { position: relative; }

@media (max-width: 700px) {
    .dm-container { border: none; height: calc(100vh - 53px); height: calc(100dvh - 53px); position: relative; overflow: hidden; }
    /* x.com 风格：列表与对话全屏叠加，通过横向滑动切换 */
    .dm-sidebar {
        width: 100%;
        position: absolute;
        inset: 0;
        transform: translateX(0);
        transition: transform .25s ease;
        z-index: 1;
    }
    .dm-container.show-thread .dm-sidebar { transform: translateX(-100%); }
    /* 移动端不可拖拽调节宽度 */
    .dm-resizer { display: none; }
    /* 显示对话区返回按钮 */
    .dm-back { display: flex; }
    .dm-thread {
        width: 100%;
        position: absolute;
        inset: 0;
        transform: translateX(100%);
        transition: transform .25s ease;
        z-index: 2;
        background: var(--bg-primary);
    }
    .dm-container.show-thread .dm-thread { transform: translateX(0); }
    /* 移动端不使用桌面折叠按钮（用 show-thread 全屏切换），忽略 dm-collapsed 宽度 */
    .dm-collapse-btn { display: none; }
    .dm-container.dm-collapsed .dm-sidebar { width: 100%; }
    .dm-container.dm-collapsed .dm-sidebar-header h1,
    .dm-container.dm-collapsed .dm-search { display: block; }
    .dm-container.dm-collapsed .dm-list .dm-item-link { padding: 12px 16px; justify-content: flex-start; }
    .dm-container.dm-collapsed .dm-list .dm-item-body { display: block; }
    .dm-container.dm-collapsed .dm-list .dm-item-link .avatar-md { width: 40px; height: 40px; }
    .dm-thread-header { padding: 10px 12px; }
    .dm-compose { padding: 10px 12px; }
    .dm-messages { padding: 12px; }
    /* 气泡在窄屏略放宽，避免文字被过度截断 */
    .dm-bubble-inner { max-width: 78%; }
    .dm-bubble-media { max-width: 62vw; max-height: 62vw; }
    /* 移动端长按菜单：保持微信尺寸感，仅靠高度适配手指点击 */
    .dm-ctx-menu .dm-ctx-item { height: 50px; padding: 0; font-size: 16px; }
    /* 转发/收藏选择弹层在窄屏占满宽度，防止溢出视口
       （需重置 left/transform：6315 媒体查询置 transform:none 但残留 left:50%，会导致弹层偏出屏幕） */
    .dm-modal { left: 50%; transform: translateX(-50%); width: calc(100vw - 24px); max-height: 80vh; }
    .dm-modal-mask { padding: 12px; align-items: center; }
    .dm-emoji-picker { left: 8px; right: 8px; width: auto; }

    /* 设置页移动端排版 */
    .page-container { padding: 0 12px; }
    .page-container .page-header { margin: 0 -12px 12px; }
    .settings-card { margin-bottom: 14px; border-radius: 12px; }
    .settings-card-head { padding: 14px 16px; }
    .settings-card-head h2 { font-size: 16px; }
    .settings-card .settings-form { padding: 16px; }
    /* 分区大标题窄屏适配：收窄左右边距，描述换行 */
    .settings-section-title { margin: 22px auto 10px; padding: 0; flex-wrap: wrap; gap: 6px 8px; }
    .settings-section-title h2 { font-size: 16px; }
    .settings-section-title .settings-section-desc { flex-basis: 100%; }
    /* 头像上传行：纵向堆叠，避免文件选择框溢出 */
    .avatar-upload-row { flex-direction: column; align-items: stretch; gap: 14px; }
    .avatar-upload-row img.avatar-xl { align-self: center; }
    .avatar-upload-row input[type="file"] { width: 100%; min-width: 0; }
    .avatar-upload-main { flex-direction: column; align-items: stretch; }
    .avatar-upload-main input[type="file"] { width: 100%; min-width: 0; }
    /* 两列表单在窄屏改为单列 */
    .settings-form .form-grid { grid-template-columns: 1fr; gap: 14px; }
    /* 外观主题选项铺满 */
    .settings-theme-options { gap: 10px; }
    .theme-option { flex: 1; padding: 14px 8px; }
    .theme-option:hover { transform: none; }
    /* 操作区按钮在窄屏撑满，便于点按 */
    .settings-form .form-actions { justify-content: stretch; }
    .settings-form .form-actions .btn { flex: 1; }
    /* 账号信息行：窄屏允许换行 */
    .settings-row { flex-wrap: wrap; gap: 4px; padding: 14px 16px; }
    .settings-row-value { text-align: left; }
}

/* ============================================ */
/* 网盘（.drive-*）移动端适配（手机竖屏 ≤700px）   */
/* ============================================ */
@media (max-width: 700px) {
    .drive-page.drive-page {
        padding: 6px 10px 40px;
    }
    .drive-page .drive-header { margin: 2px 0 12px; }
    .drive-page .drive-page-title { font-size: 21px; }
    .drive-page .drive-page-sub { font-size: 12.5px; }

    /* 工具栏：面包屑整行，操作区纵向堆叠，搜索框撑满 */
    .drive-page .drive-toolbar {
        gap: 10px;
        margin-bottom: 12px;
        /* 撤销桌面端 z-index:100（其常驻高层叠上下文会盖住移动端侧边栏抽屉）。
           但 .drive-toolbar 的 backdrop-filter 会创建 stacking context，若 z-index 为 auto，
           整个工具栏子树（含排序菜单）会因 DOM 顺序晚于 .drive-list 而被文件夹图标遮挡。
           取 5：高于文件列表(auto=0)使其绘制在上，又低于侧边栏抽屉(z-index:10)避免遮挡抽屉。 */
        z-index: 5;
    }
    .drive-page .drive-breadcrumb {
        flex: 1 1 100%;
        font-size: 13px;
        padding: 4px 0;
        border-bottom: 1px solid var(--border-color);
    }
    .drive-page .drive-toolbar-right {
        flex: 1 1 100%;
        width: 100%;
        gap: 8px;
        justify-content: flex-start;
    }
    /* 搜索框优先占满一行 */
    .drive-page .drive-search {
        order: 1;
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
    .drive-page .drive-search input { width: 100%; flex: 1 1 auto; }
    /* 排序 / 视图 / 操作按钮一行平铺，可换行 */
    .drive-page .drive-sort { order: 2; }
    /* 移动端排序菜单向下展开（沿用基础规则 absolute + top: calc(100% + 6px)）。
       遮挡根因：.drive-toolbar 的 backdrop-filter 创建 stacking context，
       移动端其 z-index 被设为 auto 后，整个工具栏子树（含排序菜单）在层叠中
       因 DOM 顺序晚于 .drive-list（文件列表）而被文件夹图标绘制在上。
       解法：给 .drive-toolbar 一个介于文件列表(auto=0)与侧边栏抽屉(z-index:10)
       之间的 z-index（5），使其子树整体绘制在文件列表之上，又不盖住侧边栏抽屉。 */
    .drive-page .drive-view-toggle { order: 3; }
    .drive-page .drive-actions {
        order: 4;
        flex: 1 1 100%;
        display: flex;
        gap: 8px;
    }
    .drive-page .drive-actions .btn { flex: 1 1 0; min-width: 0; }
    /* 上传/新建按钮字号略缩，避免溢出 */
    .drive-page #btn-new-folder, .drive-page #btn-upload { font-size: 13px; padding: 8px 10px; }

    /* 配额条字号收敛 */
    .drive-page .drive-quota { font-size: 11px; }

    /* 网格视图：手机上 3 列，图标与间距收紧 */
    .drive-page .drive-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .drive-page .drive-item { padding: 14px 6px 10px; }
    .drive-page .drive-item-icon { font-size: 34px; margin-bottom: 6px; }
    .drive-page .drive-item-name { font-size: 12px; }
    .drive-page .drive-item-meta { font-size: 10px; }
    .drive-page .drive-item-select { top: 6px; left: 6px; }
    .drive-page .drive-item-select input, .drive-page .drive-td.td-select input { width: 18px; height: 18px; }

    /* 列表视图：手机端改为卡片式行，大小/时间/操作全部可见 */
    .drive-page .drive-table-head { display: none; }
    .drive-page .drive-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 10px;
        padding: 12px 10px;
        border-bottom: 1px solid var(--border-color);
    }
    .drive-page .drive-td.td-select { order: 1; flex: 0 0 auto; }
    .drive-page .drive-td.td-name { order: 2; flex: 1 1 55%; min-width: 0; }
    .drive-page .drive-td.td-actions { order: 3; flex: 0 0 auto; justify-content: flex-end; }
    /* 大小、修改时间换行到名称下方同一行显示 */
    .drive-page .drive-td.td-size, .drive-page .drive-td.td-time {
        order: 4;
        font-size: 12px;
        color: var(--text-secondary);
        line-height: 1.4;
    }
    .drive-page .drive-td.td-size { flex: 0 0 auto; margin-right: 12px; }
    .drive-page .drive-td.td-time { flex: 1 1 auto; }
    .drive-page .drive-row-label { font-size: 14px; }
    .drive-page .drive-td.td-actions { flex-direction: row; gap: 6px; flex-wrap: wrap; }
    .drive-page .drive-mini { font-size: 11px; padding: 5px 10px; }

    /* 拖拽遮罩提示字号收敛 */
    .drive-dropzone-inner { font-size: 14px; padding: 0 16px; text-align: center; }

    /* 右键菜单在手机上点击呼出：加大点按区域，避免误触 */
    .drive-page .drive-context-menu {
        position: fixed;
        z-index: 1300;
        min-width: 160px;
        box-shadow: 0 10px 30px rgba(0,0,0,.35);
    }
    .drive-page .drive-context-menu .ctx-item {
        padding: 13px 16px;
        font-size: 15px;
    }

    /* 移动端弹层（移动/重命名/输入/确认）近乎全屏，按钮撑满便于点按 */
    .drive-page .drive-move-modal .modal-content,
    .drive-page .drive-input-modal .modal-content,
    .drive-page .drive-confirm-modal .modal-content {
        width: calc(100vw - 20px);
        max-width: 100vw;
        border-radius: 14px;
    }
    .drive-page .drive-move-footer {
        display: flex;
        gap: 10px;
    }
    .drive-page .drive-move-footer .btn,
    .drive-page .drive-input-modal .drive-move-footer .btn {
        flex: 1 1 0;
        min-width: 0;
    }
    .drive-page .drive-input-field {
        width: 100%;
        font-size: 16px; /* ≥16px 避免 iOS 聚焦时自动缩放 */
        padding: 12px 12px;
    }

    /* 图片预览弹层：手机端改为真全屏（沉浸式看图），工具栏横向滚动、图片占满剩余空间 */
    .drive-page .drive-preview-modal .modal-content {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;       /* 适配移动端动态地址栏 */
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .drive-page .drive-preview-modal .modal-header {
        flex: 0 0 auto;
        background: var(--bg-elevated, #1b1b1f);
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0;
    }
    .drive-page .drive-preview-content {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow: hidden;       /* 滚动交给图片 wrap 自身 */
        display: flex;
        flex-direction: column;
        padding: 0;
    }
    /* 工具栏：手机端单行横滑，避免换行挤占图片空间 */
    .drive-page .drive-preview-toolbar {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding: 8px 10px;
    }
    .drive-page .drive-preview-toolbar .dpt-btn { flex: 0 0 auto; }
    .drive-page .drive-preview-toolbar .dpt-sep { flex: 0 0 auto; min-width: 6px; }
    .drive-page .drive-preview-body { padding: 0; flex: 1 1 auto; min-height: 0; }
    .drive-page .drive-preview-imgwrap {
        height: auto;
        flex: 1 1 auto;
        min-height: 0;          /* 关键：让 wrap 在 flex 列中正确收缩占满 */
        border-radius: 0;
        padding: 10px;
    }
    .drive-page .drive-preview-loading { font-size: 13px; padding: 8px 14px; }
}

/* 极小屏（≤380px）进一步收紧网格为 3 列不变，但减小内边距 */
@media (max-width: 380px) {
    .drive-page .drive-grid { gap: 8px; }
    .drive-page .drive-item-icon { font-size: 30px; }
}

/* ============================================ */
/* 主题切换（日间 / 夜间模式）                    */
/* ============================================ */
/* 颜色平滑过渡，避免切换时突兀 */
body, .sidebar, .main-content, .right-sidebar,
.nav-item, .btn, .post-card, .modal-content, .right-section,
.compose-form, .dm-container, .dm-sidebar, .dm-thread, input, textarea, select {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background-color .2s, transform .2s;
}
.theme-toggle:hover {
    background: var(--bg-hover);
    transform: scale(1.08);
}
.theme-toggle svg { width: 20px; height: 20px; display: block; }

/* 侧栏底部按钮：与用户区同行 */
.theme-toggle-sidebar { margin-left: 4px; }

/* 移动端顶栏按钮：始终显示 */
.theme-toggle-mobile { position: static; }
.mobile-header .theme-toggle-mobile { margin-left: auto; }

/* 桌面端隐藏移动按钮的兄弟间距已由 flex 处理 */
@media (min-width: 701px) {
    .theme-toggle-mobile { display: none; }
}

/* ============================================ */
/* 发帖：仅自己可见 切换按钮 */
.audience-private-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    transition: background-color .15s, color .15s, border-color .15s;
}
.audience-private-btn:hover { background: var(--bg-hover); }
.audience-private-btn.active {
    background: rgba(29,155,240,.12);
    color: var(--accent);
    border-color: var(--accent);
}
.audience-private-btn.active svg { fill: var(--accent); }

/* 定时发布按钮（仿 x.com 整合，风格与仅自己可见一致） */
.schedule-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    transition: background-color .15s, color .15s, border-color .15s;
}
.schedule-btn:hover { background: var(--bg-hover); }
.schedule-btn.active {
    background: rgba(29,155,240,.12);
    color: var(--accent);
    border-color: var(--accent);
}
.schedule-btn.active svg { fill: var(--accent); }

/* 定时发布面板 */
.schedule-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-elevated, #fff);
}
.schedule-panel-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.schedule-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.schedule-quick-btn {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}
.schedule-quick-btn:hover { background: rgba(29,155,240,.1); }
.schedule-datetime {
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input, #fff);
    color: var(--text-primary);
}
.schedule-panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.schedule-hint { font-size: 12px; color: var(--text-secondary); }
.post-scheduled {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}


/* =====================================================================
 * 网盘（云盘）
 * 说明：网盘页面严格遵循全站布局契约并复用全站主题变量，
 *      不再使用独立样式表，以确保与网站主题完美适配。
 * ===================================================================== */

/* 网盘页保留全站侧边栏“发布”入口（还原此前被隐藏的信息发布按钮） */
/* 注意：pan.php 仍 require 统一的 header/footer，发帖、草稿弹层照常可用 */

/* 网盘页占满整个电脑端屏幕：覆盖全站 .app / .main-content 的宽度限制 */
body[data-page="pan"] .app { max-width: 100%; }
body[data-page="pan"] .main-content { max-width: 100%; border-right: 0; }
.drive-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 12px 56px;
}
.drive-header { margin: 4px 0 16px; }
.drive-page-title { font-size: 26px; font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; margin: 0; }
.drive-page-sub { margin: 6px 0 0; font-size: 14px; color: var(--text-secondary); }

.drive-wrap { position: relative; }

/* 选择栏（多选时出现） */
.drive-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    margin-bottom: 10px;
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
    border: 1px solid var(--accent);
    border-radius: var(--radius);
}
.drive-sel-count { font-size: 14px; color: var(--text-primary); font-weight: 600; }
.drive-sel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 工具栏 */
.drive-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 8px 0;
    background: color-mix(in srgb, var(--bg-base, #fff) 88%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
}
.drive-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 200px;
    min-width: 0;
    font-size: 14px;
}
.drive-crumb {
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    font-size: 14px;
}
.drive-crumb:hover { color: var(--accent); background: var(--bg-hover); }
.drive-crumb.active { color: var(--text-primary); font-weight: 600; cursor: default; background: none; }
.drive-crumb-sep { color: var(--text-secondary); opacity: .6; }

.drive-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
/* 操作按钮组：基础（桌面）即允许换行，避免按钮在窄列中溢出页面边界 */
.drive-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
/* 键盘可达性：统一的焦点环（科学的可访问性排版） */
.drive-search input:focus-visible,
.drive-sort-btn:focus-visible,
.drive-view-btn:focus-visible,
.drive-crumb:focus-visible,
.drive-mini:focus-visible,
.drive-item:focus-visible,
.drive-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 搜索框 */
.drive-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 6px 12px;
    min-width: 180px;
    color: var(--text-secondary);
}
.drive-search input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    width: 150px;
}
.drive-search-clear {
    border: none; background: none; color: var(--text-secondary);
    cursor: pointer; font-size: 18px; line-height: 1;
}

/* 排序 */
.drive-sort { position: relative; }
.drive-sort-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 13px;
}
.drive-sort-btn:hover { background: var(--bg-hover); }
.drive-sort-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 9999;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    padding: 6px;
    min-width: 120px;
}
/* 列表视图：排序菜单向上展开，避免遮挡下方“名称/大小/时间”表头列 */
.drive-sort.sort-up .drive-sort-menu {
    top: auto;
    bottom: calc(100% + 6px);
}
.drive-sort-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}
.drive-sort-menu button:hover { background: var(--bg-hover); }
.drive-sort-menu button.active { color: var(--accent); font-weight: 600; }

/* 视图切换 */
.drive-view-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    overflow: hidden;
    flex: 0 0 auto;
}
.drive-view-btn {
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1;
    padding: 6px 11px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.drive-view-btn + .drive-view-btn { border-left: 1px solid var(--border-color); }
.drive-view-btn:hover { background: var(--bg-hover); }
.drive-view-btn.active { background: var(--accent); color: #fff; }

/* 配额条 */
.drive-quota {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-secondary);
}
.drive-quota-bar {
    flex: 1 1 auto;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 9999px;
    overflow: hidden;
}
.drive-quota-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 9999px;
    transition: width .3s;
}

/* 网格视图 */
.drive-list { min-height: 200px; }
.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.drive-item {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, border-color .12s;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.drive-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border-color));
}
.drive-item.selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
}
.drive-item.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.drive-item-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 8px;
    word-break: break-word;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--card-bg);
    background: color-mix(in srgb, var(--accent) 12%, var(--card-bg));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-color) 60%, transparent);
}
.drive-item-icon.is-folder {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
.drive-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    vertical-align: middle;
}
.drive-item-name {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}
.drive-item-meta { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
/* 回收站卡片内的行内操作（查看 / 还原 / 永久删除） */
.drive-item-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 6px;
}
/* 网格卡片较窄，操作按钮适当缩小避免拥挤 */
.drive-grid .drive-item-actions .drive-mini {
    padding: 3px 8px;
    font-size: 11px;
}
/* 回收站入口高亮态 */
#btn-trash {
    position: relative;
}
#btn-trash.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
/* 回收站数量徽标 */
.drive-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e5484d;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}
/* 回收站专用批量按钮默认隐藏，由 JS 在回收站视图下显示 */
.sel-trash-only { display: none; }
.drive-item-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}
.drive-item-select input,
.drive-td.td-select input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* 列表视图 */
.drive-table { padding: 0; min-height: 200px; }
.drive-table-head, .drive-row {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) 110px 170px 210px;
    align-items: center;
    gap: 8px;
}
.drive-table-head {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}
.drive-row {
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 50%, transparent);
}
.drive-row:last-child { border-bottom: none; }
.drive-row:hover { background: var(--bg-hover); }
.drive-row.selected { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.drive-row.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.drive-row-icon { margin-right: 8px; }
.drive-row-icon.is-folder { color: var(--accent); }
.drive-row-label { color: var(--text-primary); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-td.td-size, .drive-td.td-time { font-size: 13px; color: var(--text-secondary); }
.drive-td.td-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; row-gap: 4px; }
.drive-mini {
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 9999px;
    cursor: pointer;
    white-space: nowrap;
}
.drive-mini:hover { background: var(--bg-hover); }
.drive-mini-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.drive-mini-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

.drive-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
}
.drive-loading { padding: 48px 16px; text-align: center; color: var(--text-secondary); }

/* 拖拽上传遮罩 */
.drive-dropzone {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-base, var(--bg-elevated)));
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    z-index: 50;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.drive-dropzone.show { display: flex; }
.drive-dropzone-inner {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

/* 右键菜单 */
.drive-context-menu {
    position: fixed;
    z-index: 1000;
    display: none;
    min-width: 140px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
    padding: 4px;
}
.drive-context-menu.show { display: block; }
.drive-context-menu .ctx-item {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
}
.drive-context-menu .ctx-item:hover { background: var(--bg-hover); }
.drive-context-menu .ctx-danger { color: var(--danger); }

/* 预览 / 移动 / 输入 / 确认 弹层 */
.drive-preview-body { padding: 16px; text-align: center; position: relative; }
.drive-preview-body img,
.drive-preview-body video,
.drive-preview-body audio { max-width: 100%; max-height: 70vh; border-radius: 8px; }
.drive-preview-fallback { color: var(--text-secondary); padding: 24px; }

/* 图片智能预览排版 */
.drive-preview-imgwrap {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
    /* 可用高度：弹层内容区减去工具栏/标题/间距后的科学高度 */
    height: 68vh;
    min-height: 200px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    box-sizing: border-box;
    background:
        linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(-45deg, rgba(255,255,255,.04) 25%, transparent 25%) 0 10px / 20px 20px,
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,.04) 75%) 10px -10px / 20px 20px,
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.04) 75%) -10px 0 / 20px 20px;
    border-radius: 8px;
}
.drive-preview-imgwrap.grabbing { cursor: grabbing; }
.drive-preview-img {
    max-width: none;
    max-height: none;
    transform-origin: 0 0; /* JS 用真实 layout 尺寸，旋转以左上角为锚点 */
    border-radius: 6px;
    box-shadow: 0 2px 16px rgba(0,0,0,.45);
    user-select: none;
    -webkit-user-drag: none;
    background: #0d0d0f; /* 透明图时填充底色 */
}

/* 预览连续浏览：导航箭头与计数 */
.drive-preview-stage { position: relative; display: flex; align-items: center; }
.drive-preview-stage .drive-preview-body {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
}
.drive-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.drive-nav:hover { background: rgba(0,0,0,.8); }
.drive-nav-prev { left: 8px; }
.drive-nav-next { right: 8px; }
.drive-preview-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary, #aaa);
}
/* 图片工具栏 */
.drive-preview-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated, #1b1b1f);
    flex-wrap: wrap;
}
.dpt-btn {
    appearance: none;
    border: 1px solid var(--border-color);
    background: var(--bg, #161618);
    color: var(--text, #e9e9ec);
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.dpt-btn:hover { background: var(--bg-elevated, #232327); border-color: var(--accent, #2f81f7); }
.dpt-btn:active { transform: translateY(1px); }
.dpt-zoom { font-size: 12px; color: var(--text-secondary, #aaa); min-width: 42px; text-align: center; }
.dpt-sep { flex: 1 1 auto; }
.dpt-download { color: var(--accent, #2f81f7); border-color: var(--accent, #2f81f7); }
.drive-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    color: var(--text-secondary);
    font-size: 14px;
    background: rgba(0,0,0,.35);
    padding: 10px 16px;
    border-radius: 10px;
}
.drive-preview-frame {
    width: 100%;
    height: 72vh;
    border: 0;
    background: #fff;
    border-radius: 8px;
}
/* ---------------- 文本文件在线编辑器（filebrowser 风格） ---------------- */
.drive-editor-modal .modal-content {
    max-width: 860px;
    width: calc(100vw - 32px);
    height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.drive-editor-modal .modal-header {
    flex: 0 0 auto;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}
.drive-editor-modal .modal-header .drive-preview-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 600;
}
.drive-editor-status {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.drive-editor-status.dirty { color: #e6a23c; font-weight: 600; }
.drive-editor-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    background: var(--bg-elevated, var(--bg-primary));
}
.drive-editor-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
}
/* 左侧行号栏：与 textarea 同字体/行高/顶边距逐行对齐，纵向滚动同步，横向滚动时钉在左侧 */
.drive-editor-gutter {
    flex: 0 0 auto;
    min-width: 3.2em;
    margin: 0;
    padding: 14px 10px 14px 0;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 13.5px;
    line-height: 1.6;
    tab-size: 4;
    color: var(--text-tertiary, #6b7280);
    background: var(--bg-hover, #f5f6f7);
    border-right: 1px solid var(--border-color);
    text-align: right;
    white-space: pre;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
#drive-editor-text {
    flex: 1 1 auto;
    width: 100%;
    border: none;
    resize: none;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 13.5px;
    line-height: 1.6;
    tab-size: 4;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    white-space: pre;
    overflow: auto;
}
.drive-editor-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
}
.drive-editor-hint { flex: 1 1 auto; font-size: 12px; color: var(--text-secondary); }
.drive-editor-footer .btn { flex: 0 0 auto; }
/* 手机端：编辑器全屏，便于输入与专注 */
@media (max-width: 700px) {
    .drive-editor-modal .modal-content {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;           /* 适配移动端动态地址栏 */
        max-height: 100dvh;
        border-radius: 0;
    }
    #drive-editor-text { font-size: 14px; } /* 防止 iOS 聚焦自动放大 */
    .drive-editor-gutter { font-size: 14px; } /* 与 textarea 保持一致，行号才能逐行对齐 */
    .drive-editor-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
/* ---------------- 文本/代码在线查看器 ---------------- */
.code-viewer { display: flex; flex-direction: column; height: calc(100vh - 150px); height: calc(100dvh - 150px); background: var(--bg-elevated, #1e1e1e); border-radius: 8px; overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border-color, #333); background: var(--bg-hover, #252525); }
.code-lang { font-size: 12px; font-weight: 600; color: var(--accent, #4c9aff); letter-spacing: .3px; }
.code-meta { font-size: 12px; color: var(--text-secondary, #aaa); }
.code-spacer { flex: 1; }
.code-btn { font-size: 12px; padding: 4px 12px; border: 1px solid var(--border-color, #444); background: transparent; color: var(--text-primary, #ddd); border-radius: 6px; cursor: pointer; }
.code-btn:hover { background: var(--bg-hover, #333); }
.code-scroll { position: relative; flex: 1; overflow: auto; background: var(--bg-elevated, #1e1e1e); }
.code-pre { margin: 0; padding: 12px 14px; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 13px; line-height: 1.6; color: var(--text-primary, #d4d4d4); tab-size: 4; text-align: left; }
.code-pre .cl { display: flex; align-items: flex-start; min-height: 1.6em; text-align: left; }
/* 左侧行号栏：固定宽度、统一左对齐成列，横向滚动时 sticky 钉在左侧 */
.code-pre .ln {
    flex: 0 0 auto;
    min-width: 3.5em;
    margin-right: 1em;
    padding-right: .6em;
    text-align: right;
    color: #6b7280;
    border-right: 1px solid var(--border-color, #333);
    background: var(--bg-elevated, #1e1e1e);
    position: sticky; left: 0;
    user-select: none;
}
/* 右侧代码内容列：统一向左对齐，不受父级 text-align:center 影响 */
.code-pre .lc { flex: 1 1 auto; white-space: pre; min-width: 0; text-align: left; }
/* 语法高亮配色（浅/深色通用） */
.tk-kw { color: #569cd6; font-weight: 600; }
.tk-str { color: #ce9178; }
.tk-num { color: #b5cea8; }
.tk-com { color: #6a9955; font-style: italic; }
.tk-tag { color: #569cd6; }
.code-loading { padding: 10px; text-align: center; font-size: 13px; color: var(--text-secondary, #aaa); border-top: 1px solid var(--border-color, #333); }
.code-sentinel { height: 1px; }
/* 含代码查看器时，由 code-viewer 自身负责滚动，避免弹层二次滚动 */
.drive-preview-content:has(.code-viewer) { overflow: hidden; max-height: none; }

.drive-preview-footer,
.drive-move-footer { padding: 12px 16px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border-color); }
.drive-move-body { padding: 14px 16px; max-height: 320px; overflow: auto; }
.drive-move-list { display: flex; flex-direction: column; gap: 2px; }
.drive-move-item {
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
}
.drive-move-item:hover { background: var(--bg-hover); }
.drive-move-item.active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 600; }
.drive-input-body { padding: 16px; }
.drive-input-field {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
}
.drive-input-field:focus { outline: none; border-color: var(--accent); }

/* 离线下载 / URL 资源抓取弹层 */
.drive-field-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.drive-mode-group { display: flex; flex-direction: column; gap: 10px; }
.drive-mode-option {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    background: var(--bg-elevated);
    transition: border-color .15s, background .15s;
}
.drive-mode-option:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-color)); }
.drive-mode-option.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.drive-mode-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.drive-mode-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.drive-offline-hint { font-size: 12px; color: #e0533d; margin-top: 10px; min-height: 16px; white-space: pre-line; word-break: break-all; line-height: 1.6; }
.drive-offline-hint:empty { display: none; }
#offline-confirm[disabled] { opacity: .6; cursor: default; }
.drive-confirm-body { padding: 18px 16px; color: var(--text-primary); font-size: 15px; line-height: 1.5; }

/* ---------- 发送文件到邮箱弹层（基础结构样式） ---------- */
/* 注：drive-modal-card / drive-modal-head 等此前无对应 CSS，
   这里补全卡片容器、头部与文件列表样式，并做三端响应式适配 */
.drive-modal .drive-modal-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.drive-modal .drive-modal-sm { max-width: 440px; }
.drive-modal .drive-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    flex: 0 0 auto;
}
.drive-modal .drive-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.drive-modal .drive-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.drive-modal .drive-modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.drive-modal .drive-input-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* 文件列表：可滚动、限高，避免多选时撑爆弹层 */
.drive-mail-filelist {
    list-style: none;
    margin: 8px 0 0;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-elevated);
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.drive-mail-filelist li {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-all;
}
.drive-mail-filelist:empty { display: none; }

/* 平板端（≤1024px）：卡片略收窄，避免贴边 */
@media (max-width: 1024px) {
    .drive-modal .drive-modal-card { max-width: 420px; }
}

/* 手机端（≤600px）：弹层近乎全屏、底部按钮撑满便于点按 */
@media (max-width: 600px) {
    .drive-modal .drive-modal-card {
        max-width: 100vw;
        width: calc(100vw - 24px);
        max-height: 88vh;
        border-radius: 14px;
    }
    .drive-modal .drive-modal-head { padding: 12px 14px; }
    .drive-modal .drive-modal-title { font-size: 15px; }
    .drive-modal .drive-input-body { padding: 14px; }
    .drive-mail-filelist { max-height: 120px; }
    /* 底部操作区按钮等分撑满，提升触达体验 */
    .drive-modal .drive-move-footer {
        padding: 10px 14px;
        gap: 8px;
    }
    .drive-modal .drive-move-footer .btn {
        flex: 1 1 0;
        min-height: 42px;
        font-size: 15px;
        justify-content: center;
    }
    #sendmail-emails { font-size: 16px; } /* 16px 避免 iOS 聚焦时页面缩放 */
}

/* ---------- 压缩包在线预览（目录结构树） ---------- */
.drive-archive-loading,
.drive-archive-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.drive-archive-tree {
    padding: 8px 0;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
}
.drive-archive-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding-right: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
}
.drive-archive-row.is-dir { font-weight: 600; }
.drive-archive-row:hover { background: var(--bg-hover); }
.drive-archive-icon { flex: 0 0 auto; }
.drive-archive-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drive-archive-size {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
/* 压缩包预览工具栏信息文本 */
.drive-preview-toolbar .dpt-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 4px;
}

/* 小尺寸按钮 */
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* toast 提示 */
.drive-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: 9999px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 2000;
}
.drive-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.drive-toast.error { border-color: var(--danger); color: var(--danger); }

/* 中等屏适配：搜索框收缩、操作按钮换行，避免“上传文件”等按钮溢出边界 */
@media (max-width: 900px) {
    .drive-search { min-width: 120px; }
    .drive-search input { width: 110px; }
    .drive-actions .btn { padding: 8px 14px; font-size: 14px; }
}

/* 移动端适配 */
@media (max-width: 700px) {
    .drive-toolbar { gap: 8px; }
    .drive-breadcrumb { flex-basis: 100%; order: -1; }
    .drive-search { min-width: 0; flex: 1 1 auto; }
    .drive-search input { width: 100%; }
    .drive-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
    .drive-selection { gap: 8px; }
    .drive-sel-actions { flex-wrap: wrap; }
}

/* ============================================================
   举报弹层（X.com 风格）
   ============================================================ */
.report-modal-content {
    width: min(520px, calc(100vw - 32px));
    max-height: 86vh;
    overflow-y: auto;
    padding: 0;
    border-radius: 16px;
}
.report-modal-content .modal-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    z-index: 2;
}
.report-modal-content .modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
}
.report-modal-content .modal-close:hover { background: var(--hover-bg); }
.report-title { margin: 0; font-size: 19px; font-weight: 800; color: var(--text-primary); }

#report-form { padding: 16px; }
.report-desc {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.report-reasons { display: flex; flex-direction: column; gap: 8px; }
.report-reason-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.report-reason-item:hover { background: var(--hover-bg); }
.report-reason-item.selected { border-color: var(--accent-color); background: rgba(29,155,240,.08); }
.report-reason-item input { display: none; }
.report-reason-label { flex: 1 1 auto; font-size: 15px; color: var(--text-primary); }
.report-check { display: none; color: var(--accent-color); font-weight: 700; }
.report-reason-item.selected .report-check { display: inline; }

.report-detail-wrap { margin-top: 14px; }
.report-detail {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.report-detail:focus { outline: none; border-color: var(--accent-color); }
.report-error {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(244,33,46,.1);
    color: #f4212e;
    font-size: 13.5px;
}
.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}
.report-actions .btn { padding: 9px 20px; font-size: 15px; }
.report-actions .btn[disabled] { opacity: .6; cursor: default; }

@media (max-width: 700px) {
    .report-modal-content { width: calc(100vw - 20px); border-radius: 14px; }
    #report-form { padding: 14px; }
}

/* ============================================================
   网盘 · 三端响应式适配（电脑 / 平板 / 手机，参考 filebrowser）
   ============================================================ */

/* ── 电脑端（≥1101px）──────────────────────────────────────────
   网盘主区不再受聊天页 600px 内容宽限制，占满 .app 剩余空间；
   配合左侧/右侧栏折叠联动（原规则不变），大屏下文件网格更宽。 */
body[data-page="pan"] .main-content {
    max-width: 100%;
}

/* 工具箱页（/tools、/tools/dial）：主内容占满 .app 剩余空间，不受聊天页 600px 限制；
   配合左右侧边栏折叠联动，折叠后主内容自动加宽 */
body[data-page="tools"] .main-content {
    max-width: 100%;
}
body[data-page="tools"].left-collapsed .main-content,
body[data-page="tools"].right-collapsed .main-content {
    max-width: 100%;
}

@media (min-width: 1101px) {
    /* 桌面网格：卡片更舒展，充分利用加宽后的主区 */
    .drive-page .drive-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
    /* 桌面列表：压缩操作列，避免名称列被挤压（未折叠时主区约 655px） */
    .drive-page .drive-table-head,
    .drive-page .drive-row {
        grid-template-columns: 36px minmax(0, 1fr) 100px 140px 170px;
    }
}

/* ── 平板端（701–1100px）────────────────────────────────────────
   右侧栏已隐藏、左侧栏常驻，主区收窄：
   - 列表视图隐藏时间列并压缩操作列，给名称列留足空间；
   - 网格列同步收紧；
   - 操作按钮紧凑化，避免工具栏溢出。 */
@media (min-width: 701px) and (max-width: 1100px) {
    .drive-page .drive-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 14px;
    }
    .drive-page .drive-table-head,
    .drive-page .drive-row {
        grid-template-columns: 32px minmax(0, 1fr) 90px 150px;
    }
    .drive-page .drive-th.th-time,
    .drive-page .drive-td.td-time {
        display: none;
    }
    .drive-page .drive-actions .btn { padding: 8px 12px; font-size: 13.5px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
    /* 接近桌面宽度：搜索框恢复稍宽，保持工具栏可读性 */
    .drive-page .drive-search input { width: 150px; }
}

/* ── 手机端（≤700px，基于既有卡片式布局微调）────────────────── */
@media (max-width: 700px) {
    /* 长面包屑单行横向滚动，避免撑破布局 */
    .drive-page .drive-breadcrumb {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .drive-page .drive-breadcrumb::-webkit-scrollbar { display: none; }
    /* 操作按钮间距收紧，多按钮换行更整齐 */
    .drive-page .drive-actions { gap: 6px; }
    /* 工具栏吸顶时避开 mobile-header（53px：36px 图标 + 16px padding + 1px 边框），
       避免滚动后遮挡顶部菜单/主题按钮 */
    .drive-page .drive-toolbar { top: 53px; }
}


/* ── 群聊弹窗独立样式（桌面端）──────────────────────────
   群聊三个弹窗（发起群聊 dm-create-group / 群聊信息 dm-group-info /
   添加成员 dm-gi-add）为 messages.php 静态 HTML，与收藏/转发弹层共用
   .dm-modal 类，但 6664 区块（收藏/转发）的 width:360px/max-height:70vh
   会覆盖群聊弹窗定义，导致尺寸错乱。以下用 ID 特异性（1,0,0）隔离，
   保证群聊弹窗使用 440px 桌面尺寸、正文区可滚动，互不影响。 */
#dm-create-group, #dm-group-info, #dm-gi-add {
    width: 440px; max-width: 94vw; max-height: 86vh;
    overflow: hidden;
}
#dm-create-group .dm-modal-body,
#dm-group-info .dm-modal-body,
#dm-gi-add .dm-modal-body {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 16px 18px;
}

/* 群聊弹窗移动端适配：6315 媒体查询曾设 bottom:0/top:auto/transform:none，
   却未重置 left:50%（6240 定义），导致弹窗从视口中间向右偏出屏幕。
   此处以 ID 规则重写移动端布局：底部全宽弹出 + 正文滚动 + 安全区。 */
@media (max-width: 767px) {
    #dm-create-group, #dm-group-info, #dm-gi-add {
        left: 0; right: 0; top: auto; bottom: 0;
        width: 100%; max-width: 100%; max-height: 88vh;
        transform: none; border-radius: 16px 16px 0 0;
        overflow: hidden;
    }
    #dm-create-group .dm-modal-head,
    #dm-group-info .dm-modal-head,
    #dm-gi-add .dm-modal-head { padding: 14px 16px; }
    #dm-create-group .dm-modal-body,
    #dm-group-info .dm-modal-body,
    #dm-gi-add .dm-modal-body {
        flex: 1; min-height: 0; overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 14px;
    }
    #dm-create-group .dm-modal-foot,
    #dm-group-info .dm-modal-foot,
    #dm-gi-add .dm-modal-foot {
        padding-bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px));
    }
    /* 超窄屏成员网格每行少放一列，避免成员卡片过挤 */
    .dm-group-members { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
    .dm-group-members .dm-member .avatar-md { width: 40px; height: 40px; border-radius: 9px; }
    /* 操作按钮在窄屏均分一行，避免换行错乱 */
    .dm-group-actions .dm-btn { flex: 1; white-space: nowrap; text-align: center; }
}

/* ============================================ */
/* 移动端发帖框：全屏沉浸 + 隐藏头像 + 排版优化   */
/* ============================================ */
@media (max-width: 700px) {
    /* 全屏铺满：弹窗铺满整屏，去掉圆角与遮罩 */
    #compose-modal.modal { align-items: stretch; }
    #compose-modal .modal-overlay { display: none; }

    #compose-modal .modal-content {
        width: 100%;
        max-width: none;
        max-height: none;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* 顶部标题栏：关闭按钮(左) + 发布按钮(右) 两端对齐 */
    #compose-modal .modal-header {
        flex: 0 0 auto;
        justify-content: space-between;
        align-items: center;
        padding: calc(4px + env(safe-area-inset-top, 0px)) 10px 2px;
        border-bottom: 1px solid var(--border-color);
    }
    #compose-modal .modal-close {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    /* 发布按钮：标题栏右上角（状态由 JS 与底部按钮同步） */
    #compose-modal .compose-header-submit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 8px 20px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 999px;
    }
    #compose-modal .compose-header-submit:disabled { opacity: .6; cursor: not-allowed; }

    /* 表单体：内容可滚动，底部操作栏吸附底部 */
    #compose-modal .compose-form {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 隐藏发帖人头像，输入区独占整行 */
    #compose-modal .compose-body { gap: 0; }
    #compose-modal .compose-body > img.avatar-md { display: none; }

    #compose-modal .compose-body textarea {
        width: 100%;
        flex: 1;
        align-self: stretch;
        font-size: 20px;
        line-height: 1.55;
        min-height: 30vh;
    }

    /* 底部操作栏：两行布局（工具行全宽 + 功能行），flex-wrap 保证永不溢出屏幕 */
    #compose-modal .compose-footer {
        position: sticky;
        bottom: 0;
        z-index: 5;
        flex-wrap: wrap;
        gap: 8px 10px;
        margin-left: -16px;
        margin-right: -16px;
        padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
    }
    /* 第一行：工具栏全宽横滚 */
    #compose-modal .compose-tools {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        gap: 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    #compose-modal .compose-tools::-webkit-scrollbar { display: none; }
    #compose-modal .compose-tool-btn {
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #compose-modal .compose-tool-btn svg { width: 22px; height: 22px; }

    /* 第二行：回复权限 / 仅自己可见 / 定时 图标化（隐藏文字） */
    #compose-modal .reply-audience-btn,
    #compose-modal .audience-private-btn,
    #compose-modal .schedule-btn {
        flex: 0 0 auto;
        height: 40px;
        padding: 0 14px;
        border-radius: 999px;
    }
    #compose-modal .reply-audience-btn span,
    #compose-modal .audience-private-btn span,
    #compose-modal .schedule-btn span { display: none; }

    /* 第二行右侧：字数统计（发布/存草稿按钮已在标题栏与工具栏，隐藏） */
    #compose-modal .compose-actions { margin-left: auto; gap: 8px; }
    #compose-modal .compose-actions .btn,
    #compose-modal #save-draft-btn { display: none; }

    /* 定时面板通栏 */
    #compose-modal .schedule-panel { width: 100%; }

    /* 内容区块通栏对齐（回复条/编辑横幅/引用卡/位置条等） */
    #compose-modal .compose-reply-to,
    #compose-modal .compose-edit-banner,
    #compose-modal .compose-time-edit,
    #compose-modal .compose-quote-preview,
    #compose-modal .compose-location-box {
        margin-left: 16px;
        margin-right: 16px;
    }
    #compose-modal .compose-media-preview {
        padding-left: 16px;
        padding-right: 16px;
    }
    #compose-modal .compose-image-url-box { padding: 0 2px; }
    #compose-modal .emoji-picker { margin-bottom: 4px; }
}


