/**
 * 黄瓜吧 风格 CSS — Style B: Fresh（方案 A · 清新，2026-10 改版）
 * 黄瓜绿主色 + 浅色导航 + 发丝边框 + 系统字体栈
 *
 * 生成方式：以 style-a.css 为底稿（结构、交互、各页面样式全部沿用），
 *   1) 替换下方 :root / html.dark 设计 token；
 *   2) 把底稿里写死的珊瑚橙替换为 token；
 *   3) 文件末尾「方案 A 覆盖层」按设计稿精修各组件。
 * 回滚：includes/header.php 里把 style-b.css 改回 style-a.css 即可（style-a.css 未改动）。
 */

/* ===== 基础重置 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Brand - 黄瓜绿 */
    --accent: #16A34A;
    --accent-soft: rgba(22,163,74,0.12);
    --accent-hover: #15913F;
    --accent-text: #15803D;      /* 绿色文字（链接/标签/高亮），比 --accent 深一档保证白底可读 */
    --on-accent: #FFFFFF;        /* 绿色底上的文字/图标 */
    --mint: #16A34A;
    --mint-soft: rgba(22,163,74,0.12);
    --rose: #E5484D;
    --rose-soft: rgba(229,72,77,0.1);
    --amber: #E5A000;
    --amber-soft: rgba(229,160,0,0.12);
    --sky: #3B82F6;
    --sky-soft: rgba(59,130,246,0.1);

    /* Surfaces & text */
    --nav-bg: #FFFFFF;
    --nav-hover: rgba(17,24,19,0.05);
    --nav-text: #111813;
    --nav-text-2: #4B554E;
    --nav-border: rgba(17,24,19,0.07);
    --logo-chip: #111813;        /* Logo 白字为深色底设计，浅色导航下垫一块深色底 */
    --body-bg: #F5F7F5;
    --card-bg: #FFFFFF;
    --bg-secondary: #F1F4F1;
    --bg-tertiary: #E6EBE7;
    --inset-bg: #F7F9F7;
    --text-primary: #111813;
    --text-secondary: #4B554E;
    --text-muted: #8A938C;
    --border-color: rgba(17,24,19,0.07);
    --border-strong: rgba(17,24,19,0.14);
    --link-color: #15803D;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --radius-card: 18px;
    --shadow: 0 1px 2px rgba(16,24,20,0.03);
    --shadow-sm: 0 1px 2px rgba(16,24,20,0.03);
    --shadow-md: 0 1px 2px rgba(16,24,20,0.04), 0 10px 30px -10px rgba(16,24,20,0.14);
    --shadow-lg: 0 12px 40px -8px rgba(16,24,20,0.18), 0 2px 6px rgba(16,24,20,0.05);
    --input-bg: #FFFFFF;
    --btn-bg: #F1F4F1;
    --btn-hover: #E6EBE7;
    --upload-bg: #F7F9F7;
    --upload-hover: rgba(22,163,74,0.06);
    --tag-bg: #F1F4F1;
    --tag-hover: rgba(22,163,74,0.12);
    --vote-bg: #F1F4F1;
    --sidebar-bg: #FFFFFF;
    --seg-bg: #E9EDEA;           /* 分段控件底 */
    --seg-active: #FFFFFF;       /* 分段控件选中块 */
    --switch-off: #D3D9D4;
    --banner-bg: #ECF7EF;
    --banner-text: #14532D;
    --pin-bg: #111813;
    --pin-text: #FFFFFF;

    /* Font stacks — 系统字体，零占用，含中文兜底 */
    --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", Roboto, sans-serif;
    --font-display: var(--font-base);

    /* Legacy compat */
    --green: #16A34A;
    --green-hover: #15803D;
    --red: #E5484D;
    --red-hover: #D93A3F;
    --blue: #16A34A;
    --blue-hover: #15913F;
    --orange: #F59E0B;
}

/* ===== 暗黑模式 ===== */
html.dark {
    --accent: #3DDC84;
    --accent-soft: rgba(61,220,132,0.14);
    --accent-hover: #5BE49A;
    --accent-text: #4ADE80;
    --on-accent: #04220F;
    --mint: #3DDC84;
    --mint-soft: rgba(61,220,132,0.14);
    --rose: #F87171;
    --rose-soft: rgba(248,113,113,0.14);
    --amber: #F5C542;
    --amber-soft: rgba(245,197,66,0.14);
    --sky: #60A5FA;
    --sky-soft: rgba(96,165,250,0.14);

    --nav-bg: #0A0C0B;
    --nav-hover: rgba(255,255,255,0.06);
    --nav-text: #ECF1ED;
    --nav-text-2: #A3ADA6;
    --nav-border: rgba(255,255,255,0.06);
    --logo-chip: transparent;
    --body-bg: #0A0C0B;
    --card-bg: #121513;
    --bg-secondary: #1A1E1B;
    --bg-tertiary: #242925;
    --inset-bg: #0E110F;
    --text-primary: #ECF1ED;
    --text-secondary: #A3ADA6;
    --text-muted: #6B756E;
    --border-color: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.13);
    --sidebar-bg: #121513;
    --link-color: #4ADE80;
    --shadow: none;
    --shadow-sm: none;
    --shadow-md: 0 10px 30px -10px rgba(0,0,0,0.6);
    --shadow-lg: 0 16px 48px -8px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
    --input-bg: #0E110F;
    --btn-bg: #1A1E1B;
    --btn-hover: #242925;
    --upload-bg: #0E110F;
    --upload-hover: #1A1E1B;
    --tag-bg: #1A1E1B;
    --tag-hover: rgba(61,220,132,0.14);
    --vote-bg: #1A1E1B;
    --seg-bg: #161A17;
    --seg-active: #262B27;
    --switch-off: #333A35;
    --banner-bg: #0F1D14;
    --banner-text: #BBF7D0;
    --pin-bg: #ECF1ED;
    --pin-text: #0A0C0B;
}

html.dark .post-image { background: #1A1A1E; }
html.dark .upload-area { background: var(--upload-bg); }
html.dark .form-input { background: var(--input-bg); color: var(--text-primary); }
html.dark .btn { background: var(--btn-bg); color: var(--text-primary); }
html.dark .btn:hover { background: var(--btn-hover); }
html.dark .vote-btn { background: var(--vote-bg); border-color: var(--border-color); color: var(--text-secondary); }
html.dark .vote-btn:hover { background: var(--btn-hover); }
html.dark .tag-link { background: var(--tag-bg); color: var(--link-color); }
html.dark .tag-link:hover { background: var(--tag-hover); }
html.dark .sidebar-tag { background: var(--tag-bg); color: var(--text-primary); }
html.dark .sidebar-tag:hover { background: var(--tag-hover); }
html.dark .ranking-num { background: var(--tag-bg); color: var(--text-muted); }
html.dark .comment-input-wrap textarea { background: var(--input-bg); color: var(--text-primary); border-color: var(--border-color); }
html.dark textarea { background: var(--input-bg); color: var(--text-primary); border-color: var(--border-color); }
html.dark .post-content, html.dark .post-content-excerpt { color: var(--text-secondary); }
html.dark .site-footer { background: var(--card-bg); border-color: var(--border-color); }

body {
    font-family: var(--font-base);
    background: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }
video { max-width: 100%; }

/* ===== 导航栏 ===== */
.navbar {
    background: var(--nav-bg);
    /* 背景为不透明色，backdrop-filter 视觉上不可见，却会在移动端 Chrome 每帧重绘整页模糊，
       导致部分 GPU 上首页假死、无法点击，故移除（详见手机端卡顿反馈） */
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 全屏播放时（含B站iframe全屏）隐藏吸顶导航/固定浮层，避免遮挡视频 */
html.is-fullscreen .navbar,
html.is-fullscreen .app-download-banner,
html.is-fullscreen .back-to-top,
html.is-fullscreen .notif-panel,
html.is-fullscreen .notif-backdrop {
    display: none !important;
}

/* ===== APP 下载提示 ===== */
.app-download-banner {
    background: linear-gradient(90deg, #252525 0%, #1A1A1A 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-download-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.app-download-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.app-download-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-download-badge {
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 100px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.app-download-version {
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}
.app-download-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.app-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease;
}
.app-download-btn:hover {
    text-decoration: none;
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.app-download-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.app-download-close:hover { background: rgba(255,255,255,0.2); }
.app-download-banner.is-hidden { display: none; }

@media (max-width: 768px) {
    .app-download-inner {
        padding: 8px 12px;
        align-items: center;
        flex-direction: row;
        gap: 8px;
    }
    .app-download-copy {
        font-size: 12px;
        gap: 6px;
        line-height: 1.2;
        min-width: 0;
    }
    .app-download-badge {
        padding: 1px 6px;
        font-size: 10px;
    }
    .app-download-version {
        display: none;
    }
    .app-download-actions {
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
        gap: 8px;
    }
    /* 44px 触摸热区（iOS HIG 最小可点尺寸）：这两个按钮紧邻，尺寸太小容易点错对象 */
    .app-download-btn {
        height: 44px;
        padding: 0 14px;
        font-size: 12px;
    }
    .app-download-close {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    text-decoration: none;
    font-family: var(--font-display);
    letter-spacing: -0.5px;
}
.nav-brand:hover { text-decoration: none; }

.nav-brand .nav-logo {
    height: 36px;
    width: auto;
    max-height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}
/* Style A: nav links white text on dark bg */
.nav-link {
    color: rgba(255,255,255,0.55);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
    text-decoration: none;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }
html.dark .nav-link { color: rgba(255,255,255,0.55); }
html.dark .nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
html.dark .nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
    font-weight: 700 !important;
}
.nav-btn:hover { box-shadow: 0 4px 12px rgba(22,163,74,0.3); }

.nav-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    vertical-align: middle;
    margin-right: 4px;
}

.admin-link { background: rgba(248,113,113,0.15); color: #F87171 !important; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    /* 触摸热区补到 44x44（iOS HIG 最小可点尺寸），图标本身尺寸不变，靠 padding 撑开热区 */
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
}
.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
}

.mobile-menu {
    display: none;
    background: var(--nav-bg);
    /* 同 .navbar：不透明背景下毛玻璃无视觉效果，移除以避免移动端 Chrome 合成器卡顿 */
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu.active {
    display: flex;
    /* 外链多时菜单可能比屏幕还高，导航栏高度 64px，留个安全余量 */
    max-height: calc(100vh - 70px);
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
}

.mobile-link {
    color: #fff;
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}
html.dark .mobile-link { border-top-color: rgba(255,255,255,0.06); }

/* 移动端开关区 */
.mobile-toggles {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.mobile-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.mobile-toggle-item:active { background: rgba(255,255,255,0.06); }
.mobile-toggle-label {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}
.mobile-toggle-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    color: #fff;
}
.mobile-link:hover { background: rgba(255,255,255,0.06); text-decoration: none; color: var(--accent-text); }

/* 侧边栏外链入口（手机网页版，与 APP 共用 app_links 配置） */
.mobile-menu-sep { height: 7px; }
.mobile-link-ext { display: flex; align-items: center; gap: 10px; }
.mobile-link-ico { width: 22px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mobile-link-ico svg { width: 20px; height: 20px; }

/* 桌面导航“更多”下拉（与 APP/手机网页共用 app_links 外链） */
.nav-more { position: relative; display: inline-flex; align-items: center; }
.nav-more-btn { background: none; border: 0; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; }
.nav-more-caret { font-size: 12px; transition: transform .15s ease; }
.nav-more.open .nav-more-caret { transform: rotate(180deg); }
.nav-more-menu { position: absolute; top: calc(100% + 10px); right: 0; min-width: 180px; background: var(--nav-bg, #1b1b1f); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 6px; box-shadow: 0 14px 34px rgba(0,0,0,.32); z-index: 1000; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s; }
.nav-more.open .nav-more-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition: opacity .16s ease, transform .16s ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) { .nav-more-menu { transition: none; transform: none; } }
.nav-more-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav-more-item:hover { background: rgba(255,255,255,0.10); color: var(--accent-text); text-decoration: none; }
.nav-more-ico { width: 20px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.nav-more-ico svg { width: 18px; height: 18px; }

/* ===== 主布局 ===== */
.main-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.content-area { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* ===== 排序栏 ===== */
.sort-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-tabs { display: flex; gap: 6px; }

.sort-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    background: transparent;
    text-decoration: none;
    transition: all 0.25s;
}
.sort-tab svg { flex-shrink: 0; }
.sort-tab:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.sort-tab.active {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 4px 12px rgba(22,163,74,0.25);
}

.current-tag {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.remove-tag {
    color: var(--rose);
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    line-height: 1;
}

/* ===== 帖子卡片 ===== */
.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s cubic-bezier(0.16,1,0.3,1), transform 0.3s cubic-bezier(0.16,1,0.3,1), border-color 0.3s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(22,163,74,0.22); }
/* 详情页大卡不做位移抬起，避免长内容跳动 */
.post-card.detail-card:hover { transform: none; }

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 12px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}
.post-author:hover { text-decoration: none; }

.avatar-sm { width: 40px; height: 40px; border-radius: 14px; object-fit: cover; border: 2px solid var(--border-color); }
.avatar-xs { width: 28px; height: 28px; border-radius: 10px; object-fit: cover; }

.avatar-placeholder {
    width: 40px; height: 40px; border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-soft), var(--sky-soft));
    color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
}
.avatar-placeholder-xs {
    width: 28px; height: 28px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-soft), var(--sky-soft));
    color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
}
.avatar-placeholder-lg {
    width: 80px; height: 80px; border-radius: 24px;
    background: linear-gradient(135deg, var(--accent-soft), var(--sky-soft));
    color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800;
}

.author-name { font-weight: 700; font-size: 14px; }
.post-time { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.post-title {
    padding: 4px 24px 12px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    font-family: var(--font-display);
}
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--accent-text); text-decoration: none; }

/* 图片区 */
.post-images {
    padding: 0 16px;
}
.post-images.multi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    padding-bottom: 8px;
}
/* 2张图：并排 */
.post-images.multi[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}
/* 3张图：三列一行 */
.post-images.multi[data-count="3"] {
    grid-template-columns: 1fr 1fr 1fr;
}
.post-images.multi[data-count="3"] .post-image-wrap:last-child {
    grid-column: auto;
    max-width: 100%;
}
/* 4张图：2×2网格 */
.post-images.multi[data-count="4"] {
    grid-template-columns: 1fr 1fr;
}
/* 5-9张图：3列 */
.post-images.multi[data-count="5"],
.post-images.multi[data-count="6"],
.post-images.multi[data-count="7"],
.post-images.multi[data-count="8"],
.post-images.multi[data-count="9"] {
    grid-template-columns: repeat(3, 1fr);
}

.post-image-wrap {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--radius-sm);
    /* 数据库没存图片宽高，加载前 <img> 不知道该占多高，给个保守最小值防止
       "先是 0 高度、图片加载完瞬间把下面内容整块顶下去"这种最明显的跳动 */
    min-height: 120px;
}

.post-image {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: var(--body-bg);
}

/* 首页长图：限制最大高度 + cover裁剪底部，加"长图"标签提示 */
.post-card:not(.detail-card) .post-images:not(.multi) .post-image-wrap.long-img-card .post-image {
    height: 400px;
    max-height: none;
    object-fit: cover;
}
@media (max-width: 768px) {
    .post-card:not(.detail-card) .post-images:not(.multi) .post-image-wrap.long-img-card .post-image {
        height: 280px;
    }
}
@media (max-width: 480px) {
    .post-card:not(.detail-card) .post-images:not(.multi) .post-image-wrap.long-img-card .post-image {
        height: 220px;
    }
}

/* 首页长图渐变遮罩 + 提示 */
.long-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.55));
    padding: 28px 0 10px;
    text-align: center;
    pointer-events: none;
    z-index: 3;
}
.long-img-overlay span {
    display: inline-block;
    background: rgba(0,0,0,0.4);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 12px;
}

/* 首页长图底部渐变遮罩 */
.post-card:not(.detail-card) .post-images:not(.multi) .post-image-wrap.long-img-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, rgba(0,0,0,0.35));
    pointer-events: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.multi .post-image {
    height: 200px;
    object-fit: cover;
}

/* ===== 图片 + 视频混排媒体区 ===== */
/* 视频格子复用 .post-image-wrap 的栅格与圆角，内部嵌一个 .post-video 走既有的
   懒加载封面 + Plyr 逻辑；点封面即在原位内联播放（同一时刻只播一个由 app.js 保证）。 */
.post-image-wrap.is-video {
    cursor: default;
    background: #000;
}
/* 混排格子里的视频封面（没有内嵌 <video> 标签，见 post_media_view.php 头部注释）：
   整个格子本身就是点击热区，点了弹放大灯箱，鼠标要显示手型而不是继承上面的 default。 */
.post-image-wrap.video-grid-cover {
    cursor: pointer;
}
/* 三段选择器：压过后面 .detail-card .post-video 的 margin/max-width（同特异度靠后者会赢） */
.detail-card .post-media-grid .post-video,
.post-card .post-media-grid .post-video,
.post-media-grid .post-video {
    margin: 0;
    max-width: none;
}
.post-media-grid .post-video video,
.post-media-grid .video-lazy-poster-img {
    border-radius: var(--radius-sm);
}
.post-media-grid.multi .post-video video,
.post-media-grid.multi .post-video .plyr,
.post-media-grid.multi .post-video .plyr__video-wrapper,
.post-media-grid.multi .video-lazy-poster-img,
.post-media-grid.multi .video-lazy-placeholder {
    height: 200px;
    max-height: 200px;
    object-fit: cover;
}
/* 九宫格里的播放按钮相应缩小，避免盖满整格 */
.post-media-grid.multi .video-lazy-play {
    width: 46px;
    height: 46px;
}
.post-media-grid.multi .video-lazy-play::before {
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 15px;
}
/* 单个媒体时不裁剪，保持原有整幅展示 */
.post-media-grid:not(.multi) .post-video video,
.post-media-grid:not(.multi) .video-lazy-poster-img {
    height: auto;
    object-fit: contain;
}

.gif-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--rose), var(--accent));
    color: #fff;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}
/* 图片+N覆盖层（仅移动端显示） */
.img-more-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(22,163,74,0.5);
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    pointer-events: none;
}
.img-more-overlay span {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* 纯文字帖占位封面 */
.post-text-cover {
    margin: 4px 16px 0;
    border-radius: var(--radius-sm);
    padding: 24px 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.post-text-cover-content {
    color: rgba(255,255,255,0.92);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 标签 */
.post-tags {
    padding: 8px 24px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-link {
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    background: var(--accent-soft);
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.25s;
}
.tag-link:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }

/* 底部操作栏 */
.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: nowrap;
    gap: 8px;
    overflow: hidden;
}

.vote-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--vote-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.25s;
    white-space: nowrap;
}
.vote-btn:hover { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }

.vote-btn.upvote.voted {
    background: var(--mint-soft);
    border-color: var(--mint);
    color: var(--mint);
}

.vote-count { font-weight: 700; }
.vote-score {
    font-weight: 800;
    font-size: 16px;
    min-width: 30px;
    text-align: center;
}

/* ===== 点赞「连击爆表」动效（方案A：纯前端表现，不计入计数/热门榜） ===== */
.vote-btn { position: relative; }
.like-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
    z-index: 4;
}
@keyframes vb-burst {
    0%   { transform: translate(-50%, -50%) scale(.2); opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(.35); opacity: 0; }
}
@keyframes vb-shake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    20%  { transform: translate(-2px, 0) rotate(-7deg); }
    50%  { transform: translate(2px, -1px) rotate(7deg); }
    80%  { transform: translate(-1px, 0) rotate(-4deg); }
}
.vb-shaking svg { animation: vb-shake .44s ease; }
.like-combo {
    position: absolute;
    transform: translate(-50%, -50%);
    font-weight: 900;
    font-size: 16px;
    pointer-events: none;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    z-index: 5;
}
@keyframes vb-combo {
    0%   { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
    25%  { opacity: 1; }
    100% { transform: translate(-50%, -185%) scale(1.35); opacity: 0; }
}

/* 收藏 / 评论赞 — 爆心锚点 + 星星粒子 */
.bookmark-btn, .bookmark-btn-sm, .comment-vote-btn { position: relative; }
.like-particle.star {
    border-radius: 0;
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

/* 列表卡片进场（滚动进入视口淡入上滑；由 JS 加 .reveal 后才隐藏，禁用 JS 时不受影响）*/
.post-card.reveal { opacity: 0; transform: translateY(18px); }
.post-card.reveal.in-view {
    opacity: 1;
    transform: none;
    transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .3, 1);
}
.comment-item.reveal, .ranking-item.reveal { opacity: 0; transform: translateY(14px); }
.comment-item.reveal.in-view, .ranking-item.reveal.in-view {
    opacity: 1;
    transform: none;
    transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .3, 1);
}
/* 按钮按压微反馈（网页统一） */
.btn:active, .vote-btn:active, .bookmark-btn:active, .bookmark-btn-sm:active,
.tag-link:active, .sort-tab:active, .nav-link:active, .comment-vote-btn:active {
    transform: scale(0.94);
}

/* 空状态微动效 */
.empty-state { animation: es-fade-in .5s ease both; }
@keyframes es-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.empty-state .empty-state-icon {
    display: block;
    margin: 0 auto 14px;
    color: var(--text-muted);
    opacity: .55;
    animation: es-float 2.8s ease-in-out infinite;
}
@keyframes es-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* 全屏彩带礼花（发帖成功庆祝） */
.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    transition: opacity .5s ease;
}
.confetti-layer.confetti-out { opacity: 0; }
.confetti-piece {
    position: absolute;
    top: -16px;
    border-radius: 2px;
    will-change: transform;
    animation-name: confetti-fall;
    animation-timing-function: cubic-bezier(.2, .6, .4, 1);
    animation-fill-mode: forwards;
}
@keyframes confetti-fall {
    0%   { transform: translate(0, -10vh) rotate(0); opacity: 1; }
    100% { transform: translate(var(--drift), 110vh) rotate(var(--rot)); opacity: .9; }
}
.confetti-card {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%) scale(.4);
    text-align: center;
    animation: confetti-pop .5s cubic-bezier(.2, .8, .3, 1.4) forwards;
}
@keyframes confetti-pop {
    to { transform: translate(-50%, -50%) scale(1); }
}
.confetti-check {
    width: 84px;
    height: 84px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #FF6B35), #FF8255);
    color: #fff;
    font-size: 44px;
    line-height: 84px;
    box-shadow: 0 10px 28px rgba(22,163,74, .5);
}
.confetti-msg {
    margin-top: 14px;
    display: inline-block;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 15px;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: nowrap;
}
.stat-item { color: var(--text-muted); text-decoration: none; white-space: nowrap; font-weight: 700; }
.stat-item:hover { text-decoration: underline; }
.post-stats .stat-item { display: inline-flex; align-items: center; gap: 5px; }
.post-stats .stat-item svg { flex-shrink: 0; opacity: .85; }
/* 图标体系统一：标题/链接/标签内的线性图标与文字对齐 */
.sidebar-title, .section-title, .form-title { display: flex; align-items: center; gap: 8px; }
.submit-rules-title { display: flex; align-items: center; gap: 7px; }
.profile-tab { display: inline-flex; align-items: center; gap: 6px; }
.sidebar-link { display: flex; align-items: center; gap: 8px; }
.ranking-count { display: inline-flex; align-items: center; gap: 3px; }
.emoji-toggle-btn { display: inline-flex; align-items: center; justify-content: center; }
.sidebar-title svg, .section-title svg, .form-title svg, .submit-rules-title svg,
.profile-tab svg, .sidebar-link svg, .ranking-count svg { flex-shrink: 0; }

/* 收藏按钮 - 详情页 */
.bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}
.bookmark-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
}
.bookmark-btn.bookmarked {
    border-color: var(--amber);
    color: var(--amber);
    background: var(--amber-soft);
}

/* 收藏按钮 - 列表页(小图标) */
.bookmark-btn-sm {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: all 0.2s;
}
.bookmark-btn-sm:hover {
    color: var(--amber);
}
.bookmark-btn-sm.bookmarked {
    color: var(--amber);
}

/* 分享按钮 */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}
.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    background: var(--accent-soft);
}
.share-btn.copied {
    border-color: var(--mint);
    color: var(--mint);
    background: var(--mint-soft);
}

/* 举报按钮 - 列表页(小图标) */
.report-btn-sm {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}
.report-btn-sm:hover {
    color: var(--rose);
    opacity: 1;
}

/* 举报按钮 - 详情页 */
.report-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    opacity: 0.7;
}
.report-btn:hover {
    border-color: var(--rose);
    color: var(--rose);
    opacity: 1;
}

/* 评论举报按钮 — hover时才显示，跟点赞按钮一致 */
.comment-report-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    opacity: 0;
}
.comment-item:hover .comment-report-btn {
    opacity: 1;
}
.comment-report-btn:hover {
    color: var(--rose);
    background: var(--rose-soft);
}

/* 举报弹窗 */
.report-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}
.report-modal {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s;
}
.report-modal h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #111);
}
.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.report-reason-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-primary, #111);
}
.report-reason-item:hover {
    border-color: var(--rose);
    background: var(--rose-soft, rgba(248,113,113,0.08));
}
.report-reason-item.selected {
    border-color: var(--rose);
    background: var(--rose-soft, rgba(248,113,113,0.12));
    font-weight: 600;
}
.report-reason-item .reason-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}
.report-reason-item .reason-text {
    flex: 1;
}
.report-detail-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--input-bg, #f9f9f9);
    color: var(--text-primary, #111);
    resize: none;
    margin-bottom: 16px;
    font-family: inherit;
    box-sizing: border-box;
}
.report-detail-input::placeholder {
    color: var(--text-muted);
}
.report-detail-input:focus {
    outline: none;
    border-color: var(--rose);
}
.report-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.report-modal-actions .btn-cancel {
    padding: 8px 20px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}
.report-modal-actions .btn-cancel:hover {
    border-color: var(--text-muted);
}
.report-modal-actions .btn-submit {
    padding: 8px 24px;
    border-radius: 100px;
    border: none;
    background: var(--rose);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.report-modal-actions .btn-submit:hover {
    opacity: 0.9;
}
.report-modal-actions .btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 侧边栏 ===== */
.sidebar-section {
    background: var(--sidebar-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-soft);
}

/* 侧边栏搜索框 */
.sidebar-search-section { padding: 14px; }
.sidebar-search-form {
    display: flex; align-items: center; width: 100%;
    border-radius: 21px; transition: box-shadow .2s;
}
/* 聚焦时整条药丸高亮（光晕加在整个 form 上，避免中缝露线） */
.sidebar-search-form:focus-within {
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(22,163,74,0.12));
}
.sidebar-search-input {
    flex: 1; min-width: 0; height: 42px; padding: 0 16px;
    border: 1px solid var(--border-color); border-right: none;
    border-radius: 21px 0 0 21px;
    background: var(--input-bg); color: var(--text-primary);
    font-size: 14px; line-height: 42px; outline: none;
    -webkit-appearance: none; appearance: none;
    transition: border-color .2s;
}
.sidebar-search-input::placeholder { color: var(--text-secondary, #9aa0a6); opacity: 1; }
/* 去掉浏览器对 type=search 的原生清除按钮，避免外观不统一 */
.sidebar-search-input::-webkit-search-decoration,
.sidebar-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sidebar-search-form:focus-within .sidebar-search-input { border-color: var(--accent); }
@media (max-width: 768px) {
    .sidebar-search-input { font-size: 16px; }
}
.sidebar-search-btn {
    flex: none; height: 42px; padding: 0 18px; border: none;
    border-radius: 0 21px 21px 0;
    background: var(--accent); color: var(--on-accent); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background .25s;
}
.sidebar-search-btn:hover { background: var(--accent-hover); }

/* 今日统计卡片 */
.today-stats .stats-grid {
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: center;
}
.today-stats .stat-item {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    text-decoration: none;
    transition: background 0.2s;
    border-radius: var(--radius-sm);
}
.today-stats .stat-item:hover {
    background: var(--accent-soft);
    text-decoration: none;
}
.today-stats .stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--rose));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}
.today-stats .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 700;
}
.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* 每日签到日历卡片 */
.signin-card-link, .signin-card-link:hover { display: block; text-decoration: none; }

.signin-summary {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.signin-weekdays,
.signin-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.signin-weekdays { margin-bottom: 6px; }
.signin-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.signin-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-height: 26px;          /* aspect-ratio 不生效的老浏览器兜底 */
    border-radius: var(--radius-sm);
    background: var(--vote-bg);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}
.signin-day.is-blank { background: transparent; }
.signin-day.is-signed { background: var(--mint); color: #fff; }
.signin-day.is-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.signin-day.is-future { opacity: .35; }

.signin-cta {
    margin-top: 10px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-text);
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }

.sidebar-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s;
}
.sidebar-tag:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); text-decoration: none; }
.sidebar-tag.active { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.tag-count { font-size: 10px; color: var(--text-muted); }
.sidebar-tag.active .tag-count { color: rgba(255,255,255,0.7); }
.sidebar-tag-more {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-text);
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.25s;
}
.sidebar-tag-more:hover { background: var(--accent-soft); border-color: var(--accent); }
#moreTagsContainer .sidebar-tag { animation: fadeIn 0.2s ease; }

.sidebar-link {
    display: block;
    padding: 8px 0;
    color: var(--link-color);
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-link:last-child { border-bottom: none; }

.tips-list {
    list-style: none;
    font-size: 13px;
    color: var(--text-secondary);
}
.tips-list li { padding: 4px 0; padding-left: 16px; position: relative; }
.tips-list li::before { content: '•'; position: absolute; left: 0; color: var(--accent-text); }

/* ===== 排行榜 ===== */
.ranking-list { list-style: none; }
.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.ranking-item:last-child { border-bottom: none; }

.ranking-num {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--body-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}
.ranking-num.top3 {
    background: linear-gradient(135deg, var(--accent), var(--rose));
    color: #fff;
}

.ranking-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}
.ranking-name:hover { text-decoration: none; color: var(--accent-text); }

.ranking-link {
    color: var(--text-secondary);
}

.ranking-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===== 排行榜Tab卡片（桌面端与移动端统一使用，可点击切换） ===== */
.ranking-tabs-card {
    display: block; /* PC 与移动端统一用 Tab 卡片，把 24h/7天/30天热帖等放到一起切换 */
    background: var(--sidebar-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 20px;
}
.ranking-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0;
}
.ranking-tab {
    flex: 1;
    min-width: 0; /* 等分收缩，3 个 tab 在 300px 侧栏里也不溢出 */
    padding: 10px 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.25s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ranking-tab:hover { color: var(--accent-text); }
.ranking-tab.active {
    color: var(--accent-text);
    border-bottom-color: var(--accent);
}
.ranking-tab-panels { padding-top: 10px; }
.ranking-panel { display: none; }
.ranking-panel.active { display: block; }
.ranking-tabs-card .sidebar-title { margin-bottom: 10px; }
.ranking-empty { padding: 14px 4px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* 排行榜统一用上方 Tab 卡片切换，PC 端不再单独平铺各 section */
.ranking-pc { display: none; }

/* ===== 广告位 ===== */
.sidebar-ad .ad-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
}
.sidebar-ad .ad-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.content-ad {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}
.content-ad img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state p { font-size: 18px; margin-bottom: 16px; font-weight: 700; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    background: var(--btn-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; border-color: var(--accent); color: var(--accent-text); }

.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(22,163,74,0.3); color: #fff; }

.btn-success { background: var(--mint); color: #fff; border-color: transparent; }
.btn-success:hover { background: var(--green-hover); color: #fff; }

.btn-danger { background: var(--red); color: #fff; border-color: transparent; }
.btn-danger:hover { background: var(--red-hover); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; color: var(--text-primary); }
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color 0.25s;
    background: var(--input-bg);
    font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
/* 移动端字号<16px时 iOS Safari 聚焦输入框会自动放大整页，桌面端不受影响所以只在这里覆盖 */
@media (max-width: 768px) {
    .form-input { font-size: 16px; }
}

.required { color: var(--red); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }

/* 上传区 */
.post-form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 28px;
}

.form-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: var(--upload-bg);
}
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); background: var(--accent-soft); }

.upload-hint p { color: var(--text-muted); font-size: 14px; }
.upload-sub { font-size: 12px !important; margin-top: 4px; }

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.preview-item:hover { box-shadow: var(--shadow-md); }
.preview-item.dragging {
    opacity: 0.4;
    transform: scale(0.9);
    cursor: grabbing;
}
.preview-item.drag-over {
    border: 2px dashed var(--accent);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}
.preview-order {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .gif-badge { top: 4px; right: 4px; font-size: 9px; padding: 1px 4px; }
/* 媒体队列里的视频卡片：黑底 + 左上角「视频」角标，与图片一眼区分 */
.preview-item.is-video { background: #000; }
.preview-video-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 1px 6px;
    border-radius: 100px;
}
.preview-noposter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
    padding: 0 6px;
}
/* 节点视频记录已被清理/转码失败：编辑页当场标红，省得用户保存时才撞上报错还找不到是哪一格 */
.preview-noposter.preview-failed {
    background: #3a1620;
    color: #ff9aa8;
    line-height: 1.5;
}
.preview-item.is-failed {
    outline: 2px solid #e0405e;
    outline-offset: -2px;
}
/* 并发上传占位格：格子在选中/拖入的那一刻就按最终顺序占好位，上传过程中原地显示进度，
   完成后原地换成真正的缩略图——所以外观要跟正常格子同尺寸，只是内容换成进度指示 */
.preview-item.is-uploading { cursor: default; }
.preview-uploading {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; background: #eef1f5; color: var(--text-muted);
}
.preview-progress-spin {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.12); border-top-color: var(--accent);
    animation: preview-spin 0.8s linear infinite;
}
@keyframes preview-spin { to { transform: rotate(360deg); } }
.preview-progress-text { font-size: 11px; line-height: 1.3; text-align: center; padding: 0 6px; }
.preview-progress-track {
    width: 76%; height: 4px; border-radius: 2px; background: rgba(0,0,0,0.12); overflow: hidden;
}
.preview-progress-fill {
    height: 100%; width: 0%; background: var(--accent); border-radius: 2px; transition: width 0.2s;
}
.remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 视觉尺寸不变（叠在小缩略图角落，做成 44px 会遮住大半张图），
   靠透明伪元素把实际可点区域扩到接近 44px，缩略图网格本身有 gap 不会互相打架 */
.remove-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
}
.remove-btn:hover { background: rgba(0,0,0,0.8); }

/* 微博图片抓取选择网格（B站动态采集共用同一套网格样式） */
.weibo-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.weibo-grab-item {
    position: relative;
    display: inline-block;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.weibo-grab-item:hover {
    box-shadow: var(--shadow-md);
}
.weibo-grab-item:has(input:checked) {
    border-color: var(--mint);
    box-shadow: 0 0 0 1px var(--mint);
}
.weibo-grab-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.weibo-grab-item input[type="checkbox"] {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--mint);
}
.weibo-grab-item .gif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
}

.upload-progress { margin-top: 8px; }
.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--rose));
    border-radius: 3px;
    transition: width 0.3s;
    width: 0%;
}
#progressText { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 标签选择 */
.tag-select { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-group { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.tag-group-title {
    width: 100%;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 0 2px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 2px;
}
.tag-checkbox { cursor: pointer; }
.tag-checkbox input { display: none; }
.tag-label {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.25s;
}
.tag-checkbox input:checked + .tag-label {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}
/* 辅助分类折叠 */
.tag-group-secondary .tag-checkbox { display: none !important; }
.tag-group-secondary.expanded .tag-checkbox { display: inline-flex !important; }
.tag-group-secondary .toggle-hint::after { content: ' ▸ 展开'; font-size: 11px; color: var(--text-muted); }
.tag-group-secondary.expanded .toggle-hint::after { content: ' ▾ 收起'; font-size: 11px; color: var(--text-muted); }
/* 主分类按钮 */
.primary-cat-btn {
    padding: 8px 18px; border: 2px solid var(--border-color); border-radius: 100px;
    font-size: 14px; font-weight: 700; color: var(--text-secondary);
    background: var(--card-bg); cursor: pointer; transition: all 0.2s;
    user-select: none; white-space: nowrap;
}
.primary-cat-btn:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.primary-cat-btn.active {
    background: var(--accent); color: var(--on-accent); border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}
/* 主分类子标签区域 */
.primary-sub-tags { animation: fadeIn 0.2s ease; }
/* 已选标签汇总栏 */
#selectedTagsBar { display: none; margin-top: 8px; padding: 8px 12px; background: var(--accent-soft); border-radius: 12px; }
#selectedTagsBar .bar-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
#selectedTagsInner { display: flex; flex-wrap: wrap; gap: 6px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 视频播放器 (Plyr) ===== */
.post-video {
    position: relative;
    margin: 4px 16px 0;
    max-width: 640px;
}
.post-video video {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #000;
    display: block;
}
.post-video .plyr {
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.post-card:not(.detail-card) .post-video .plyr,
.post-card:not(.detail-card) .post-video .plyr__video-wrapper {
    max-height: 600px;
}
.detail-card .post-video {
    margin: 16px auto;
    max-width: 640px;
}
.detail-card .post-video video,
.detail-card .post-video .plyr,
.detail-card .post-video .plyr__video-wrapper {
    max-height: none;
}
.video-badge {
    display: none; /* Plyr 自带播放按钮，隐藏 VIDEO 徽章 */
}
.post-video.video-waiting video {
    display: none;
}
/* 自建视频服务器上的视频是异步转码的，还没就绪时摆这个占位框，
   由 video-server.js 轮询，就绪后自动替换成播放器 */
.post-video.video-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    background: #16181d;
    border-radius: var(--radius-sm);
}
.post-video.video-pending .video-pending-tip {
    color: #9aa3ad;
    font-size: 13px;
    text-align: center;
    padding: 12px 16px;
    line-height: 1.7;
}
/* 网格里的「转码中」占位要和同排图片一样高，否则那一格会缩成一条字，整排参差。
   不能写 min-height:100%：外层格子的高度是内容撑起来的（高度不定），
   百分比在这种父级上会被解析成 auto，等于把上面那条 160px 也一起废掉。 */
.post-media-grid.multi .post-video.video-pending {
    min-height: 200px;
}
.video-lazy-poster-img {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: #000;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.detail-card .video-lazy-poster-img {
    max-height: none;
}
.video-lazy-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 600px;
    border-radius: var(--radius-sm);
    background: #000;
    color: #94a3b8;
    cursor: pointer;
}
.video-lazy-placeholder span {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
}
.video-lazy-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: rgba(22,163,74, 0.94);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, background 0.18s ease;
}
.video-lazy-play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-left: 19px solid #fff;
    transform: translate(-50%, -50%);
}
.video-lazy-play:hover {
    background: rgba(22,163,74, 1);
    transform: translate(-50%, -50%) scale(1.06);
}
.video-lazy-play:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.85);
    outline-offset: 3px;
}
.post-video.video-loaded .video-lazy-play {
    display: none;
}

/* 视频封面卡片（首页/个人页，点击进详情播放） */
.post-video-cover {
    padding: 0 16px;
}
.post-video-cover a {
    display: block;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}
.post-video-cover img {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: #000;
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.post-video-cover a:hover img { transform: scale(1.03); }
.post-video-cover .video-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background: #000;
    color: #555;
}
.post-video-cover .video-badge {
    display: block;
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--rose), var(--accent));
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 1px;
}
.post-video-cover .video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.2s;
}
.post-video-cover a:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
}
html.dark .post-video-cover .video-cover-placeholder {
    background: rgba(255,255,255,0.05);
}
.video-error, .video-fallback {
    padding: 20px 16px;
    text-align: center;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin: 8px 0;
    border: 1px solid var(--border-color);
}
.video-error p, .video-fallback p {
    margin: 0 0 4px;
}

/* Plyr 播放器自定义样式 */
.plyr--video {
    --plyr-color-main: #16A34A;
    --plyr-video-background: #000;
    --plyr-menu-background: rgba(0,0,0,0.9);
    --plyr-control-radius: 100px;
}
.plyr__control--overlaid {
    background: rgba(22,163,74,0.85);
}
.plyr__control--overlaid:hover {
    background: rgba(22,163,74,1);
}
.plyr__control--overlaid svg {
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

/* 暗黑模式适配 */
.dark .plyr--video {
    --plyr-menu-background: rgba(0,0,0,0.95);
}

@media (max-width: 768px) {
    .post-video { margin: 4px 8px 0; max-width: 100%; }
    .post-video video,
    .post-card:not(.detail-card) .post-video .plyr,
    .post-card:not(.detail-card) .post-video .plyr__video-wrapper { max-height: 280px; }
    .post-video-cover { padding: 0 8px; }
    .post-video-cover img { max-height: 280px; }
    .post-link-preview { padding: 0 8px; }
    .detail-card .post-video { margin: 12px 8px; max-width: 100%; }
    .detail-card .post-video video { max-height: 360px; }
    /* 移动端 Plyr 播放按钮稍小 */
    .plyr__control--overlaid {
        padding: 20px;
    }
    .plyr__control--overlaid svg {
        height: 28px;
        width: 28px;
    }
}

/* ===== 详情页 ===== */
.detail-card { margin-bottom: 20px; }
.detail-title {
    font-family: var(--font-display);
    font-size: 26px;
    padding: 0 24px 14px;
    font-weight: 800;
    line-height: 1.3;
}
.detail-footer { padding: 14px 24px; }
/* 只对详情页「单张图」生效：显示原始比例，不裁剪。
 * 必须带 :not(.multi)——混排宫格里这条选择器如果也命中，会把图片格子撑到跟它
 * 原始高度一样高，CSS Grid 默认 align-items:stretch 又会把同一行的视频格子拉伸
 * 到相同高度，但视频封面内部固定 200px 不会跟着长高，多出来的空间会露出
 * .post-image-wrap.is-video 的黑色背景——即混排图文里「视频下方一大块黑色区域」的真正成因。 */
.detail-images:not(.multi) .post-image { max-height: none; height: auto; object-fit: contain; }

/* 超长图折叠 — 只对JS标记了tall-image的生效，普通图不受影响 */
.detail-images:not(.multi) .post-image-wrap {
    position: relative;
}
.detail-images:not(.multi) .post-image-wrap.tall-image {
    max-height: 85vh;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1);
}
.detail-images:not(.multi) .post-image-wrap.expanded {
    max-height: none;
    overflow: visible;
}
.detail-images:not(.multi) .post-image-wrap.tall-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(transparent, var(--card-bg, #fff));
    pointer-events: none;
    transition: opacity 0.3s;
}
.detail-images:not(.multi) .post-image-wrap.expanded::after {
    opacity: 0;
}
.expand-long-img {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}
.expand-long-img:hover {
    background: rgba(0,0,0,0.8);
    transform: translateX(-50%) scale(1.03);
}
.expand-long-img svg {
    width: 16px;
    height: 16px;
}
.expand-long-img.hidden { display: none; }
.collapse-long-img {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    background: var(--vote-bg, #F5F3EF);
    border: none;
    border-radius: var(--radius-sm, 8px);
    color: var(--text-secondary, #5C5C5C);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 5;
}
.collapse-long-img.hidden { display: none; }
.collapse-long-img.visible { display: flex; }
.collapse-long-img:hover {
    background: var(--btn-hover, rgba(0,0,0,0.06));
}
/* 移动端收起按钮更醒目 */
@media (max-width: 768px) {
    .collapse-long-img.visible {
        padding: 14px;
        font-size: 15px;
        background: var(--accent-soft, rgba(22,163,74,0.12));
        color: var(--accent-text);
        margin-bottom: 8px;
        position: sticky;
        bottom: 8px;
    }
}

/* 暗色模式 */
html.dark .detail-images:not(.multi) .post-image-wrap.tall-image::after {
    background: linear-gradient(transparent, var(--card-bg, #16161A));
}

/* 详情页布局：让图片/内容区铺满宽度 */
.detail-card .post-images,
.detail-card .post-content {
    max-width: 100%;
}

/* ===== 底部版权 ===== */
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}
.site-footer p { margin: 0; }
.site-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
}
.site-footer .footer-links span { color: var(--text-muted); opacity: 0.45; }
.site-footer .content-policy-text {
    font-size: 11px;
    font-weight: 400;
    margin-top: 6px;
    opacity: 0.6;
}

/* ===== 法务与联系页面 ===== */
.legal-page {
    width: min(920px, calc(100% - 32px));
    margin: 28px auto 0;
}
.legal-hero {
    padding: 34px 0 22px;
    border-bottom: 1px solid var(--border-color);
}
.legal-kicker {
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.legal-hero h1 {
    font-size: 34px;
    line-height: 1.2;
    margin-bottom: 10px;
}
.legal-hero p {
    color: var(--text-secondary);
    max-width: 720px;
}
.legal-updated {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}
.legal-content {
    padding: 24px 0 12px;
}
.legal-content h2 {
    font-size: 20px;
    margin: 28px 0 10px;
}
.legal-content p,
.legal-content li {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.85;
}
.legal-content ul {
    padding-left: 22px;
    margin: 8px 0 12px;
}
.legal-content a {
    font-weight: 700;
}
.contact-method {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}
.contact-method:first-child {
    padding-top: 0;
}
.contact-method h2 {
    margin-top: 0;
}
.contact-email {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
}

/* ===== 新帖提示条（Discuz风格） ===== */
.new-posts-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(22,163,74, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
}
.new-posts-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22,163,74, 0.35);
}
.new-posts-bar:active {
    transform: translateY(0);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
html.dark .new-posts-bar {
    background: linear-gradient(135deg, #e55a2b, #d94420);
}

/* ===== 回到顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--rose));
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(22,163,74,0.3);
    z-index: 1001;
    padding: 0;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(22,163,74,0.4);
}
@media (max-width: 768px) {
    .back-to-top { bottom: 16px; right: 16px; width: 44px; height: 44px; }
}

/* ===== 相关推荐 ===== */
.related-posts-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.related-posts-section .section-title {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.related-post-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.related-post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.related-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 65%;
    background: var(--bg-tertiary, #e9ecef);
    overflow: hidden;
}
.related-thumb-wrap img.related-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-thumb-wrap.related-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    height: 80px;
}
.related-thumb-wrap.related-no-thumb span {
    font-size: 28px;
}
.related-gif-badge {
    position: absolute;
    top: 6px; right: 6px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.related-title {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
    padding: 8px 10px 6px;
}
.related-meta {
    display: flex;
    gap: 10px;
    padding: 0 10px 10px;
    font-size: 11px;
    color: var(--text-muted);
}
.related-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ===== 评论区 ===== */
.comments-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-soft);
}

.comment-form { margin-bottom: 20px; }
.comment-input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.comment-input-wrap textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.25s;
}
.comment-input-wrap textarea:focus { outline: none; border-color: var(--accent); }
@media (max-width: 768px) {
    .comment-input-wrap textarea { font-size: 16px; }
}
/* 评论质量提示"还差 N 个汉字"：配合 textarea 的 data-quality-hint 属性 +
   app.js 里统一的 input 事件委托实时更新，见 app.js 的 commentShortfallHan() */
.comment-quality-hint {
    font-size: 12px;
    line-height: 1.4;
    color: var(--red, #e5484d);
    margin-top: 4px;
}
.comment-quality-hint:empty { display: none; }

/* ===== 表情面板 ===== */
.emoji-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s;
    line-height: 1;
    /* button 不继承父级 color，不写死就会拿浏览器默认的黑，暗色模式下看不见 */
    color: var(--text-muted);
}
.emoji-toggle-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-text);
}
.emoji-panel {
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-width: 480px;
}
/* Twemoji 统一渲染 */
.emoji-panel img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}
.emoji-item img.emoji {
    height: 1.2em;
    width: 1.2em;
}
.emoji-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}
.emoji-tabs::-webkit-scrollbar { height: 0; }
.emoji-tab-btn {
    flex-shrink: 0;
    padding: 6px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.25s;
    /* 「颜文字」「符号」「表情包分组名」这几个标签是纯文字，必须显式给色 */
    color: var(--text-secondary);
}
.emoji-tab-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.emoji-tab-btn.active {
    border-bottom-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 2px;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
}
.emoji-grid::-webkit-scrollbar { width: 4px; }
.emoji-grid::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 22px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    user-select: none;
}
.emoji-item:hover {
    background: var(--accent-soft);
    transform: scale(1.2);
}

/* 颜文字/符号 文本项样式 */
.emoji-grid.text-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.emoji-item.text-item {
    width: auto;
    min-width: 36px;
    height: auto;
    font-size: 13px;
    line-height: 1.3;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.emoji-item.text-item:hover {
    background: var(--accent-soft);
    transform: scale(1.05);
}

html.dark .emoji-panel { background: var(--card-bg); }
html.dark .emoji-tab-btn:hover { background: rgba(255,255,255,0.05); }
html.dark .emoji-tab-btn.active { background: rgba(255,255,255,0.05); }
html.dark .emoji-item:hover { background: rgba(255,255,255,0.08); }
html.dark .emoji-item.text-item:hover { background: rgba(255,255,255,0.08); }

/* 回复框表情按钮 */
.reply-form .emoji-toggle-btn { padding: 2px 6px; font-size: 16px; }
.reply-form .emoji-panel { max-width: 440px; }
.reply-form .emoji-grid.sticker-grid { max-height: 300px; }

/* ===== 表情包贴图 ===== */
.emoji-grid.sticker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 10px;
    max-height: 320px;
    overflow-y: auto;
}
.emoji-item.sticker-item {
    width: auto;
    height: auto;
    padding: 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    overflow: hidden;
}
.emoji-item.sticker-item img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    object-fit: contain;
}
.emoji-item.sticker-item:hover {
    background: var(--accent-soft);
    transform: scale(1.05);
}
/* 评论中的贴图渲染 */
img.comment-sticker {
    max-width: 150px;
    max-height: 150px;
    border-radius: 6px;
    vertical-align: middle;
    display: inline-block;
    margin: 2px 4px;
}

/* 移动端 */
@media (max-width: 768px) {
    .emoji-grid { max-height: 150px; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); }
    .emoji-item { width: 32px; height: 32px; font-size: 20px; }
    .emoji-grid.sticker-grid { grid-template-columns: repeat(5, 1fr); max-height: 280px; gap: 4px; }
    img.comment-sticker { max-width: 100px; max-height: 100px; }
    .emoji-grid.text-grid { max-height: 180px; gap: 3px; padding: 6px; }
    .emoji-item.text-item { font-size: 12px; padding: 3px 4px; }
    .emoji-panel { max-width: 100%; }
}

/* 链接预览配图 */
.post-link-preview {
    padding: 0 16px;
}
.post-link-preview a { display: block; }
.post-link-preview img {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: var(--body-bg);
    border-radius: var(--radius-sm);
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.post-link-preview a:hover img { transform: scale(1.02); }
html.dark .post-link-preview img { background: rgba(255,255,255,0.03); }

.login-prompt {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.comment-list { margin-top: 16px; overflow-x: hidden; }
.no-comments { color: var(--text-muted); text-align: center; padding: 20px; font-size: 14px; }

.comment-item {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child { border-bottom: none; }

/* 嵌套评论：用左侧竖线表示层级 */
.comment-item.depth-1,
.comment-item.depth-2,
.comment-item.depth-3,
.comment-item.depth-4,
.comment-item.depth-5 {
    margin-left: 0;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
    margin-top: 4px;
}
.comment-item.depth-1 { border-left-color: var(--accent); }
.comment-item.depth-2 { border-left-color: var(--rose); }
.comment-item.depth-3 { border-left-color: var(--mint); }
.comment-item.depth-4 { border-left-color: var(--amber); }
.comment-item.depth-5 { border-left-color: var(--sky); }

.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.comment-author { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.comment-time { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.comment-text { font-size: 14px; line-height: 1.65; color: var(--text-secondary); word-break: break-word; }
.comment-text a, .comment-link { color: var(--primary, #1a73e8); text-decoration: none; word-break: break-all; }
.comment-text a:hover, .comment-link:hover { text-decoration: underline; }

.comment-actions { margin-top: 4px; display: flex; gap: 4px; align-items: center; }
.reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    transition: all 0.25s;
}
.reply-btn:hover { color: var(--accent-text); background: var(--accent-soft); }
.comment-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    color: var(--text-muted);
    transition: all 0.25s;
}
.comment-action-btn:hover { background: var(--accent-soft); }
.comment-action-btn.edit-btn:hover { color: var(--accent-text); }
.comment-action-btn.delete-btn:hover { color: var(--red); }
.comment-deleted-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--vote-bg);
    padding: 2px 8px;
    border-radius: 100px;
}
.comment-edited-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--tag-bg);
    padding: 2px 8px;
    border-radius: 100px;
    font-style: italic;
}
.edit-form { margin-top: 8px; }
.edit-textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: vertical;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    line-height: 1.5;
}
.edit-textarea:focus { outline: none; border-color: var(--accent); }
.edit-actions { margin-top: 6px; display: flex; gap: 8px; }

.reply-form { margin-top: 8px; }
.reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    resize: vertical;
    min-height: 40px;
    font-family: inherit;
}
.reply-form textarea:focus { outline: none; border-color: var(--accent); }
.reply-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ===== 个人中心 ===== */
.profile-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 20px;
}

.profile-header { display: flex; gap: 20px; align-items: flex-start; position: relative; }
.profile-avatar img {
    width: 80px; height: 80px;
    border-radius: 24px;
    object-fit: cover;
    border: 3px solid var(--border-color);
}
.profile-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }
.profile-stats { display: flex; gap: 20px; margin-top: 12px; }
.profile-stats .stat { text-align: center; }
.profile-stats .stat-num { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.profile-joined { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.profile-actions { display: flex; gap: 8px; position: absolute; top: 0; right: 0; }

/* 个人中心 - 标签页（分段式胶囊，激活态橙色渐变） */
.profile-tabs {
    display: flex;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 6px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 0 auto;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.profile-tab svg { flex-shrink: 0; opacity: .9; }
.profile-tab:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.profile-tab.active {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 4px 12px rgba(22,163,74,0.28);
}
.profile-tab.active svg { opacity: 1; }

/* 个人中心 - 视图切换（卡片 / 列表） */
.view-toggle-bar {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 5px;
    box-shadow: var(--shadow);
}
.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.view-toggle-btn svg { flex-shrink: 0; }
.view-toggle-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.view-toggle-btn.active {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 3px 10px rgba(22,163,74,0.25);
}

/* 列表模式：把卡片压成紧凑单行，只显示标题，悬停浮现预览图 */
.post-list.list-mode {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.post-list.list-mode .post-card {
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: none !important;
    transform: none !important;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s ease;
}
.post-list.list-mode .post-card:last-child { border-bottom: none; }
.post-list.list-mode .post-card:hover { background: var(--accent-soft); }
.post-list.list-mode .post-images,
.post-list.list-mode .post-video,
.post-list.list-mode .post-tags,
.post-list.list-mode .vote-buttons,
.post-list.list-mode .post-header { display: none !important; }
.post-list.list-mode .post-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 14.5px;
}
.post-list.list-mode .post-title a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.post-list.list-mode .post-footer {
    margin: 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
    width: auto;
    gap: 0;
}
.post-list.list-mode .post-stats { gap: 14px; }

/* 列表模式：鼠标跟随的预览图浮层 */
.list-hover-preview {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.22);
    padding: 4px;
}
.list-hover-preview.show { opacity: 1; transform: scale(1); }
.list-hover-preview img {
    display: block;
    max-width: 260px;
    max-height: 260px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}
/* 触屏设备没有 hover，预览图无意义，隐藏 */
@media (hover: none) {
    .list-hover-preview { display: none !important; }
    /* 触屏没有真正的 :hover，评论点赞按钮原来靠 .comment-item:hover 才显示，
       触屏用户除非已经点赞过，否则根本发现不了这个按钮存在 */
    .comment-vote-btn {
        opacity: 1;
        padding: 8px 10px;
        min-height: 44px;
    }
    /* "滚轮缩放 · ESC关闭" 对触屏用户毫无意义（没有滚轮也没有 ESC 键），
       左右切换本身已经有可见的箭头按钮提示，不靠这行文字 */
    .lightbox-hint { display: none; }
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    background: var(--body-bg);
    color: var(--text-muted);
}
.badge-success { background: var(--mint-soft); color: var(--mint); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--rose-soft); color: var(--rose); }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--card-bg);
    text-decoration: none;
    transition: all 0.25s;
    text-align: center;
    box-sizing: border-box;
    padding: 0 14px;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent-text); text-decoration: none; }
.page-btn.active { background: var(--accent); color: var(--on-accent); border-color: transparent; pointer-events: none; }
.page-btn.page-disabled {
    color: var(--text-muted);
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.page-ellipsis {
    padding: 8px 6px;
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 2px;
    user-select: none;
}

/* 跳页（页码下方居中一行，复用页码按钮 .page-btn 风格） */
.page-jump {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: -8px;
    padding-bottom: 12px;
}
.page-jump .jump-text {
    font-size: 13px;
    color: var(--text-muted);
}
.page-jump-input {
    width: 58px;
    height: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
    -moz-appearance: textfield;
    transition: border-color 0.2s, color 0.2s;
}
.page-jump-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 13px;
}
.page-jump-input::-webkit-outer-spin-button,
.page-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.page-jump-input:focus {
    outline: none;
    border-color: var(--accent);
    color: var(--accent-text);
}
.page-jump-btn {
    cursor: pointer;
    font-family: inherit;
}

/* 个人中心 - 评论历史列表 */
.comment-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment-history-item {
    position: relative;
    display: block;
    padding: 15px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.comment-history-item::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-hover));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.2s ease;
}
.comment-history-item:hover {
    border-color: rgba(22,163,74,0.22);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.comment-history-item:hover::before { transform: scaleY(1); }
.comment-history-text {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-primary);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.comment-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px dashed var(--border-color);
    flex-wrap: wrap;
}
.comment-history-post {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-text);
    background: var(--accent-soft);
    padding: 4px 11px;
    border-radius: 100px;
    min-width: 0;
    max-width: 65%;
}
.comment-history-post svg { flex-shrink: 0; }
.comment-history-post-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comment-history-post.deleted { color: var(--text-muted); background: var(--bg-tertiary); }
.comment-history-info {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.comment-history-up {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-text);
    font-weight: 700;
}

/* ===== 灯箱 ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: auto;
}
.lightbox.active { display: flex; }
.lightbox.zoomed {
    cursor: grab;
}
.lightbox.zoomed.dragging { cursor: grabbing; }

.lightbox-content {
    margin: auto;
    flex-shrink: 0;
}
.lightbox-content img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}
/* 放大后去除尺寸限制，由JS设宽高 */
.lightbox.zoomed .lightbox-content img {
    max-width: none;
    max-height: none;
    object-fit: fill;
}

.lightbox-close {
    position: fixed;
    top: 12px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-hint {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #ccc;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 100px;
    z-index: 1001;
    pointer-events: none;
    transition: opacity 0.3s;
}
.lightbox.zoomed .lightbox-hint { opacity: 0; }

/* 灯箱多图导航 */
.lightbox-prev, .lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(0,0,0,0.8); }
.lightbox.zoomed .lightbox-prev, .lightbox.zoomed .lightbox-next { opacity: 0; pointer-events: none; }

.lightbox-counter {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 14px;
    padding: 4px 14px;
    border-radius: 100px;
    z-index: 1001;
    pointer-events: none;
}
.lightbox.zoomed .lightbox-counter { opacity: 0; }

@media (max-width: 768px) {
    /* 移动端触摸设备更需要大热区，不该比桌面端还缩小；保持跟桌面一致的 44px */
    .lightbox-prev, .lightbox-next {
        font-size: 20px;
    }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* ===== 视频灯箱：图片+视频混排网格里的视频格子被压得很小，点击后弹出放大播放 =====
 * 结构与图片灯箱（.lightbox）一致，复用同一套 z-index/关闭按钮样式，区别只在内容是
 * Plyr 播放器而不是 <img>。
 *
 * 尺寸这里踩过一个坑：一开始把 .plyr/.plyr__video-wrapper/video 都强制 width:100%
 * 撑满容器宽度，只用 max-height 兜底。但 <video> 按 HTML 标准默认就是
 * object-fit:contain——"按原比例居中显示，播放区里视频之外的地方什么都不画"，
 * 也就是浏览器会自己拿播放器的黑色背景去补那部分空白。一旦视频真实宽高比跟这个
 * "先撑满宽度再兜底高度"算出来的框不一致（尤其手机竖拍的视频，先前那 800px+ 的宽度对它
 * 完全用不上），播放器自己的黑边就会大到很显眼——不是灯箱本身画的黑框，是 <video>
 * 元素在它自己被强行撑大的框里补的背景色。
 *
 * 正确做法是反过来：不强撑宽度，让 .plyr/.plyr__video-wrapper/video 全部
 * width:auto;height:auto，只给 <video> 一个视口单位的 max-width/max-height
 * （不依赖父级尺寸，随时能解出确定值），播放器的框会跟着视频真实宽高比自己收缩到
 * 刚好包住内容，灯箱背景本来就是深色半透明，视频周围不会再多出一块突兀的黑框。
 *
 * 这里还有个 Plyr 自己的坑：它会新建一个外层 <div class="plyr plyr--video ...">
 * 包装器（真正决定播放器整体尺寸的是它），但原来那个 <video class="plyr"> 标签本身
 * 依然保留着 "plyr" 这个类不会被摘掉。也就是同一个页面里有两个元素都命中 ".plyr"——
 * 外层包装器和内层 <video> 本身。如果直接写 ".plyr{...}" 会同时套在这两个元素上，
 * 而且因为多一层嵌套关系，优先级还会盖过专门给 <video> 写的规则，
 * 把视口单位的 max-height 顶掉，导致视频按原始像素铺满、又被 <video> 自己的
 * object-fit:contain 兜出一圈黑边——正是这次要修的问题。改用 .plyr--video
 * 这个只有外层包装器才有的状态类来点选它，避免和内层 <video> 撞选择器。
 */
.video-lightbox .video-lightbox-content {
    max-width: 92vw;
    max-height: 85vh;
    margin: auto;
}
.video-lightbox .plyr--video,
.video-lightbox .plyr__video-wrapper {
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    background: #000;
}
.video-lightbox .plyr video {
    display: block;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 85vh;
    border-radius: inherit;
}
@media (max-width: 768px) {
    .video-lightbox .video-lightbox-content {
        max-width: 96vw;
        max-height: 70vh;
    }
    .video-lightbox .plyr video {
        max-width: 96vw;
        max-height: 70vh;
    }
}

/* ===== 登录/注册 ===== */
.auth-page {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 36px;
    width: 100%;
    max-width: 420px;
}
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}
/* Logo 为 4:1 宽字标（含吉祥物+站名），按高度放大、宽度撑满卡片但不溢出 */
.auth-brand-logo {
    height: 88px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 0;
}
/* Logo 本身已包含站名「黄瓜吧」，隐藏重复的文字站名 */
.auth-brand-name {
    display: none;
}
.auth-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; text-align: center; margin: 0 0 24px; color: var(--text-primary); }
.auth-error { background: var(--rose-soft); color: var(--rose); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; font-weight: 700; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.mobile-link.active { color: var(--accent-text); }

/* ===== 帖子信息（详情侧边栏） ===== */
.post-info { font-size: 14px; }
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.info-row:last-child { border-bottom: none; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }

    .main-layout { flex-direction: column; padding: 16px; }
    .sidebar { width: 100%; order: 2; }

    .content-area { order: 1; width: 100%; min-width: 0; box-sizing: border-box; }

    /* 移动端多图：最多显示3张，隐藏第4张起 */
    .post-image-wrap.mobile-hidden { display: none; }
    .img-more-overlay { display: flex; }

    .post-images.multi {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .multi .post-image { height: 140px; }
    .post-media-grid.multi .post-video video,
    .post-media-grid.multi .post-video .plyr,
    .post-media-grid.multi .post-video .plyr__video-wrapper,
    .post-media-grid.multi .video-lazy-poster-img,
    .post-media-grid.multi .video-lazy-placeholder { height: 140px; max-height: 140px; }
    .post-media-grid.multi .post-video.video-pending { min-height: 140px; }

    /* 原来 nowrap+overflow:hidden，窄屏赞/评论/浏览/收藏/举报挤不下时直接被裁掉，
       用户会以为按钮消失了；改允许换行，最多多占一行高度，总比按钮"不见了"好 */
    .post-footer { flex-wrap: wrap; overflow: visible; }
    .post-stats { flex-wrap: wrap; gap: 8px; }

    .detail-title { font-size: 20px; }

    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-info { width: 100%; }
    .profile-name { justify-content: center; }
    .profile-stats { justify-content: center; flex-wrap: wrap; }
    .profile-joined { margin-bottom: 8px; }
    .profile-bio { text-align: center; }
    .profile-actions { position: static; justify-content: center; margin-top: 16px; }

    /* 详情页移动端优化 */
    .post-header { flex-wrap: wrap; gap: 6px; }
    .detail-footer {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
    }
    .detail-footer .vote-buttons {
        gap: 6px;
    }
    .detail-footer .post-stats {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    /* 移动端操作按钮缩小（图标视觉尺寸不变，但热区补到 44px 最小可点尺寸） */
    .detail-footer .action-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
        border-radius: 100px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        box-sizing: border-box;
    }
    .detail-footer .action-btn span {
        display: none;
    }
    .detail-footer .action-btn svg {
        width: 16px;
        height: 16px;
    }
    .detail-footer .stat-item {
        font-size: 12px;
    }

    /* 编辑按钮移动端适配 */
    .detail-card .btn-sm { margin-left: 0; }
    .post-form-card { padding: 20px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn-lg { width: 100%; }
    .auth-card { padding: 24px 20px; margin: 8px; }

    .comment-item.depth-1,
    .comment-item.depth-2,
    .comment-item.depth-3,
    .comment-item.depth-4,
    .comment-item.depth-5 {
        padding-left: 14px;
        margin-left: 0;
    }

    .comment-actions { flex-wrap: wrap; gap: 2px; }

    .sort-bar { flex-direction: column; gap: 8px; }
    .sort-tabs { flex-wrap: nowrap; width: 100%; gap: 4px; }
    .sort-tab { flex: 1; padding: 8px 4px; font-size: 13px; text-align: center; white-space: nowrap; border-radius: 8px; }

    /* 移动端排行榜：Tab卡片显示，PC独立section隐藏 */
    .ranking-tabs-card {
        display: block;
        background: var(--sidebar-bg);
        border-radius: var(--radius);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        padding: 16px;
        margin-bottom: 20px;
    }
    .ranking-pc { display: none; }

    /* 详情页移动端铺满 */
    .detail-card .post-images,
    .detail-card .post-video { padding: 0; margin: 8px 0; }
    .detail-title { padding: 0 16px 10px; }
    .detail-footer { padding: 10px 16px; }
    .post-content { padding: 0 16px; }
    .post-header { padding: 16px; }
    .post-tags { padding: 8px 16px 14px; }

    /* 相关推荐移动端 */
    .related-posts-section { padding: 14px; margin-bottom: 16px; }
    .related-posts-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .related-title { font-size: 12px; padding: 6px 8px 4px; }
    .related-meta { padding: 0 8px 8px; }
}

@media (max-width: 480px) {
    .nav-container { padding: 0 16px; }
    .post-title { font-size: 16px; }
    .post-images.multi { grid-template-columns: repeat(2, 1fr) !important; }
    .post-images.multi[data-count="3"] .post-image-wrap:last-child { max-width: 100%; }
    .multi .post-image { height: 120px; }
    .post-media-grid.multi .post-video video,
    .post-media-grid.multi .post-video .plyr,
    .post-media-grid.multi .post-video .plyr__video-wrapper,
    .post-media-grid.multi .video-lazy-poster-img,
    .post-media-grid.multi .video-lazy-placeholder { height: 120px; max-height: 120px; }
    .post-media-grid.multi .post-video.video-pending { min-height: 120px; }
    .auth-card { padding: 24px 16px; }
}

/* ===== NSFW 开关 ===== */
.nsfw-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.nsfw-label {
    font-size: 12px;
    font-weight: 800;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5px;
    user-select: none;
    pointer-events: none;
}
.nsfw-switch {
    display: inline-block;
    width: 32px;
    height: 18px;
    background: rgba(255,255,255,0.15);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
    pointer-events: none;
}
.nsfw-switch.nsfw-on {
    background: var(--rose);
}
.nsfw-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    pointer-events: none;
}
.nsfw-switch.nsfw-on .nsfw-knob {
    transform: translateX(14px);
}

/* ===== 暗黑模式切换 ===== */
.dark-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.25s;
    margin: 0 4px;
    user-select: none;
    -webkit-user-select: none;
}
.dark-toggle:hover {
    background: rgba(255,255,255,0.08);
}
.dark-icon {
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    color: rgba(255,255,255,0.75);
}
.dark-toggle:hover .dark-icon { color: #fff; }
/* 暗黑切换图标：跟随 html.dark 用 CSS 切换显隐（JS 只切 html.dark 类）*/
.dark-icon .icon-sun,
.mobile-toggle-icon .icon-sun { display: none; }
.dark-icon .icon-moon,
.mobile-toggle-icon .icon-moon { display: inline-flex; }
html.dark .dark-icon .icon-sun,
html.dark .mobile-toggle-icon .icon-sun { display: inline-flex; }
html.dark .dark-icon .icon-moon,
html.dark .mobile-toggle-icon .icon-moon { display: none; }

/* ===== NSFW 内容遮罩 ===== */
.nsfw-blur {
    position: relative;
}
/* 混排网格里视频格用的是 .video-lazy-poster-img / <video poster>，都不带 .post-image，
   只写图片选择器会让 NSFW 帖的视频封面直接裸露（遮罩只是 30% 半透明黑，挡不住内容） */
.nsfw-blur .post-image,
.nsfw-blur .video-lazy-poster-img,
.nsfw-blur .post-video video,
.nsfw-blur .video-lazy-placeholder {
    filter: blur(20px);
    transition: filter 0.3s;
}
.nsfw-blur:hover .post-image,
.nsfw-blur.revealed .post-image,
.nsfw-blur:hover .video-lazy-poster-img,
.nsfw-blur.revealed .video-lazy-poster-img,
.nsfw-blur:hover .post-video video,
.nsfw-blur.revealed .post-video video,
.nsfw-blur:hover .video-lazy-placeholder,
.nsfw-blur.revealed .video-lazy-placeholder {
    filter: none;
}
.nsfw-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    /* 底图已 filter:blur(20px)，此处 backdrop-filter 视觉冗余，移除以减轻移动端 GPU 合成负担 */
    z-index: 5;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.nsfw-overlay span {
    background: linear-gradient(135deg, var(--rose), var(--accent));
    color: #fff;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ===== 文字内容排版 ===== */
.post-content, .post-content-excerpt {
    padding: 0 24px;
    margin-top: 4px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
    word-break: break-word;
    overflow-x: hidden;
}
.post-content p, .post-content-excerpt p {
    margin-bottom: 8px;
}
.post-content a, .post-content-excerpt a {
    color: var(--accent-text);
    text-decoration: underline;
    word-break: break-all;
    display: inline-block;
    margin-bottom: 6px;
}
.post-content a:hover, .post-content-excerpt a:hover {
    color: var(--accent-hover);
}
/* 「查看全文」按钮。
   选择器必须带上外层容器：上面那条 `.post-content-excerpt a` 的特异度比单个
   `.read-more-link` 高，只写后者的话 text-decoration 和 hover 颜色都会被它压回去——
   表现就是按钮带着下划线，且 hover 时橙字压在橙底上几乎看不见。 */
.post-content .read-more-link,
.post-content-excerpt .read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
    /* 不能给上下外边距：行内级盒子的垂直外边距会把自己顶出文字所在的那一行，
       还会把行高一起撑开。高度全靠内边距控制，比正文行高（15px × 1.8）略矮一点，
       这样它就是紧跟在省略号后面的一颗胶囊，而不是另起一行的一个块。 */
    margin: 0 0 0 6px;
    padding: 5px 11px 5px 14px;
    border-radius: 100px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .2px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
/* 箭头拆成伪元素，hover 时单独往右挪一点，比整块变色更有「还有下文」的暗示 */
.post-content .read-more-link::after,
.post-content-excerpt .read-more-link::after {
    content: '›';
    font-size: 15px;
    line-height: 1;
    transition: transform .2s ease;
}
.post-content .read-more-link:hover,
.post-content-excerpt .read-more-link:hover {
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(22,163,74,0.28);
    transform: translateY(-1px);
}
.post-content .read-more-link:hover::after,
.post-content-excerpt .read-more-link:hover::after {
    transform: translateX(3px);
}
.post-content .read-more-link:active,
.post-content-excerpt .read-more-link:active {
    transform: translateY(0);
    box-shadow: none;
}
.post-content .read-more-link:focus-visible,
.post-content-excerpt .read-more-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== 通知铃铛 ===== */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 100px;
    cursor: pointer;
    margin: 0 2px;
    color: rgba(255,255,255,0.6);
    transition: background 0.25s, color 0.25s;
}
.notif-bell:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--rose);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ===== 通知面板 ===== */
.notif-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: transparent;
}
.notif-panel {
    position: fixed;
    top: 72px;
    right: 16px;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: 480px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    box-sizing: border-box;
}
html.dark .notif-panel {
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-weight: 800;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
}
.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent-text);
    font-size: 13px;
    cursor: pointer;
    font-weight: 700;
}
.notif-mark-all:hover {
    text-decoration: underline;
}
/* 通知面板：全部/回复/点赞 切换 Tab */
.notif-tabs {
    display: flex;
    padding: 0 12px;
    border-bottom: 1px solid var(--border-color);
}
.notif-tab {
    flex: 1;
    padding: 10px 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .2s, border-color .2s;
    font-family: inherit;
}
.notif-tab:hover { color: var(--accent-text); }
.notif-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.notif-panel-body {
    flex: 1;
    -webkit-flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 400px;
}
.notif-loading, .notif-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}
.notif-item:hover {
    background: var(--accent-soft);
}
.notif-item.unread {
    background: var(--accent-soft);
}
.notif-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 12px;
}
.notif-item-avatar-ph {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--rose));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    margin-right: 12px;
}
.notif-item-content {
    flex: 1;
    -webkit-flex: 1;
    min-width: 0;
    overflow: hidden;
}
.notif-item-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}
.notif-item-text strong {
    font-weight: 700;
}
.notif-item-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

@media (max-width: 640px) {
    .notif-panel {
        /* 100vw 在部分移动浏览器里含滚动条宽度，会比可视区宽出十几像素；
           用 100% 相对父级（body，本身已 overflow-x:hidden）更准确 */
        width: calc(100% - 32px);
        right: 16px;
    }
}

/* ===== B站视频嵌入 ===== */
.bilibili-embed {
    margin: 8px 0;
    max-width: 100%;
}
.bilibili-embed iframe {
    border: none;
    border-radius: var(--radius-sm);
    width: 100%;
    aspect-ratio: 16 / 9;
    max-width: 800px;
    display: block;
    margin: 10px 0;
    background: #000;
}
.bilibili-embed p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

/* B站视频嵌入 - 首页卡片内 */
.bilibili-embed-card {
    padding: 0 16px;
    margin: 8px 0;
}
.bilibili-embed-card iframe {
    border: none;
    border-radius: var(--radius-sm);
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #000;
}
.bilibili-embed-card .bilibili-embed-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.bilibili-embed-card .bilibili-embed-footer a {
    color: #00a1d6;
    text-decoration: none;
}
.bilibili-embed-card .bilibili-embed-footer a:hover {
    text-decoration: underline;
}
.weibo-embed {
    margin: 8px 0;
    max-width: 100%;
}
.weibo-embed iframe {
    border: none;
    border-radius: var(--radius-sm);
    width: 100%;
    height: 500px;
    max-width: 800px;
    display: block;
    margin: 10px 0;
    background: #000;
}
.weibo-embed p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}
@media (max-width: 768px) {
    .bilibili-embed-card {
        padding: 0 8px;
    }
    .weibo-embed iframe {
        height: 360px;
    }
}

/* ===== 抖音视频嵌入（竖屏 9:16，官方 open player 不自适应，需自行约束宽高） ===== */
.douyin-embed {
    margin: 8px 0;
    max-width: 100%;
}
.douyin-embed iframe {
    border: none;
    border-radius: var(--radius-sm);
    width: min(360px, 100%);
    aspect-ratio: 9 / 16;
    display: block;
    margin: 10px auto;
    background: #000;
}
.douyin-embed p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 0 0;
    text-align: center;
}

/* 抖音视频嵌入 - 首页卡片内 */
.douyin-embed-card {
    padding: 0 16px;
    margin: 8px 0;
}
.douyin-embed-card iframe {
    border: none;
    border-radius: var(--radius-sm);
    width: min(340px, 100%);
    aspect-ratio: 9 / 16;
    display: block;
    margin: 0 auto;
    background: #000;
}
.douyin-embed-card .douyin-embed-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.douyin-embed-card .douyin-embed-footer a {
    color: #fe2c55;
    text-decoration: none;
}
.douyin-embed-card .douyin-embed-footer a:hover {
    text-decoration: underline;
}
/* 解析成功的抖音视频走站内播放器（正文 .douyin-embed / 首页 .douyin-embed-card 两处），
   尺寸对齐原来的 iframe：竖屏 9:16、居中、最宽 340~360px。这段 style.css 里早就有、
   本文件一直缺，站内播放器在正文里会按通用 .post-video 铺满整行 */
.douyin-embed .douyin-video,
.douyin-embed-card .douyin-video {
    position: relative;
    width: min(340px, 100%);
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}
.douyin-embed .douyin-video { width: min(360px, 100%); margin: 10px auto; }
.douyin-embed .douyin-video video,
.douyin-embed .douyin-video .video-lazy-poster-img,
.douyin-embed-card .douyin-video video,
.douyin-embed-card .douyin-video .video-lazy-poster-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.douyin-embed .douyin-video .video-badge,
.douyin-embed-card .douyin-video .video-badge {
    background: #fe2c55;
}
/* 没解析出播放地址时的「在抖音打开」卡片（复用 .ext-link-inline，只换成抖音红）。
   以前这里是 open.douyin.com 官方 iframe，对不允许第三方播放的视频只显示「视频暂不可用」 */
.douyin-embed-card .ext-link-inline { margin: 0 auto; }
.ext-link-inline.is-douyin:hover { border-color: #fe2c55; }
.ext-link-inline.is-douyin:hover .ext-link-open { color: #fe2c55; }
@media (max-width: 768px) {
    .douyin-embed-card {
        padding: 0 8px;
    }
}

/* 微博视频兜底卡片（微博禁止 iframe 跨站嵌入，改为封面+播放按钮+跳转） */
.weibo-video-cover {
    padding: 0 16px;
    margin: 12px 0;
}
.weibo-video-cover .weibo-video-link {
    display: block;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    max-width: 800px;
}
.weibo-video-cover img {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: #000;
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.weibo-video-cover .weibo-video-link:hover img { transform: scale(1.03); }
.weibo-video-cover .video-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 220px;
    background: #000;
    color: #999;
    font-size: 14px;
}
.weibo-video-cover .wb-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: linear-gradient(135deg, #ff8200, #e6162d);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 1px;
}
.weibo-video-cover .video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.2s;
}
.weibo-video-cover .weibo-video-link:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
}
/* 通用：转载外链来源标识（微博 / B站 / 普通外链 共用，风格统一） */
.ext-source-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 0;
    font-size: 12px;
}
.ext-source-line.standalone { padding: 0 16px; }
/* 外链抠不出播放器编号（未展开的 b23/抖音短链、图文笔记）时的降级容器：
   只留来源行，不套 .bilibili-embed / .douyin-embed 外壳，免得留一个空的播放器框 */
.ext-embed-fallback { max-width: 100%; }
.ext-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--text-muted);
}
.ext-source .ext-source-icon { flex-shrink: 0; }
.ext-source.src-weibo, .ext-source.src-weibo .ext-source-icon { color: #e6162d; }
.ext-source.src-bili, .ext-source.src-bili .ext-source-icon { color: #fb7299; }
.ext-source.src-douyin, .ext-source.src-douyin .ext-source-icon { color: #fe2c55; }
.ext-source.src-generic, .ext-source.src-generic .ext-source-icon { color: var(--text-muted); }
.ext-source-open {
    color: var(--text-muted);
    text-decoration: none;
}
.ext-source-open:hover { text-decoration: underline; }
.ext-source.src-weibo + .ext-source-open { color: #ff8200; }
.ext-source.src-bili + .ext-source-open { color: #00a1d6; }
.ext-source.src-douyin + .ext-source-open { color: #fe2c55; }
@media (max-width: 768px) {
    .weibo-video-cover { padding: 0 8px; }
    .weibo-video-cover img { max-height: 360px; }
    .ext-source-line.standalone { padding: 0 8px; }
}

/* 正文内联外链兜底卡片（如微博：禁止 iframe 跨站嵌入，改为可点击卡片） */
.ext-link-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0;
    padding: 10px 14px;
    border: 1px solid var(--border-color, rgba(0,0,0,0.1));
    border-radius: var(--radius-sm, 8px);
    background: rgba(0,0,0,0.02);
    font-size: 13px;
    max-width: 800px;
    text-decoration: none;
    color: var(--text-muted, #999);
    transition: background 0.2s, border-color 0.2s;
}
.ext-link-inline:hover { background: rgba(0,0,0,0.05); border-color: #e6162d; }
.ext-link-inline .ext-link-play { display: inline-flex; flex-shrink: 0; }
.ext-link-inline .ext-source { font-size: 13px; }
.ext-link-inline .ext-link-open { margin-left: auto; color: var(--text-muted, #999); white-space: nowrap; }
.ext-link-inline:hover .ext-link-open { color: #ff8200; }
html.dark .ext-link-inline { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); }
html.dark .ext-link-inline:hover { background: rgba(255,255,255,0.07); }

/* ===== 验证码 ===== */
.captcha-question {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 6px;
    letter-spacing: 2px;
    border: 1px solid var(--border-color);
}

/* ===== 评论点赞 ===== */
.comment-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.15s ease;
    line-height: 1;
    opacity: 0;
}
.comment-item:hover .comment-vote-btn,
.comment-vote-btn.voted {
    opacity: 1;
}
.comment-vote-btn:hover {
    color: var(--accent-text);
    background: var(--accent-soft);
}
.comment-vote-btn.voted {
    color: var(--accent-text);
}
.comment-vote-btn.voted .comment-vote-icon {
    transform: scale(1.1);
}
.comment-vote-icon {
    transition: transform 0.15s ease;
}
.comment-vote-count {
    font-size: 12px;
    font-weight: 600;
}
.comment-vote-static {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 4px;
    opacity: 0;
}
.comment-item:hover .comment-vote-static {
    opacity: 1;
}

/* ===== 底部快捷评论 ===== */
.quick-comment-bar {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
.quick-comment-bar form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.quick-comment-bar input[type="text"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}
.quick-comment-bar input[type="text"]:focus {
    border-color: var(--accent);
}
.quick-comment-bar .btn-sm {
    border-radius: 24px;
    padding: 8px 20px;
    white-space: nowrap;
}

/* ===== 热评排行 ===== */
.hot-comment-item {
    flex-wrap: wrap;
    align-items: flex-start !important;
    gap: 4px;
}
.hot-comment-item .ranking-num {
    flex-shrink: 0;
}
.hot-comment-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hot-comment-text {
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hot-comment-text:hover {
    color: var(--accent-text);
}
.hot-comment-meta {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hot-comment-item .ranking-count {
    flex-shrink: 0;
    font-size: 11px;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== UI 精修（统一收口，低风险）===== */

/* 1) 键盘焦点环：仅键盘导航可见，鼠标点击不显示；outline 自动贴合元素圆角 */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* 输入类用柔光环更贴合，去掉硬 outline */
.form-input:focus-visible,
textarea:focus-visible,
.report-detail-input:focus-visible,
.quick-comment-bar input[type="text"]:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.18);
}

/* 3) 文本选区配色（两条分开写，避免某浏览器不识别导致整条失效）*/
::selection { background: rgba(22,163,74,0.24); color: inherit; }
::-moz-selection { background: rgba(22,163,74,0.24); color: inherit; }

/* 4) 自定义滚动条（细 + 暗色感知；表情面板等已有更窄的局部规则，特异性更高不受影响）*/
html { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.22) transparent; }
html.dark { scrollbar-color: rgba(255,255,255,0.2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 100px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.30); background-clip: content-box; }
html.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); background-clip: content-box; }
html.dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.26); background-clip: content-box; }

/* 6) 标题换行优化：优先填满整行、避免末行孤字（不再强制均衡折行；不支持的浏览器自动忽略）*/
.post-title,
.detail-title,
.section-title,
.sidebar-title,
.form-title,
.legal-hero h1 { text-wrap: pretty; }

/* 7) 图片加载淡入：仅 JS 标记 .img-init 的图片参与，无 JS 时默认正常显示 */
.post-image.img-init,
.post-link-preview img.img-init { opacity: 0; }
.post-image.img-init.img-in,
.post-link-preview img.img-init.img-in { opacity: 1; transition: opacity .45s ease; }

/* 8) 前台提示条：走主题 token，暗色模式自适应（替代 index.php 旧的硬编码浅色）*/
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: rgba(52,211,153,0.14); color: #0c7a55; border-color: rgba(52,211,153,0.38); }
.alert-error,
.alert-danger { background: rgba(248,113,113,0.14); color: #c0392b; border-color: rgba(248,113,113,0.38); }
html.dark .alert-success { color: #4ade9f; border-color: rgba(52,211,153,0.3); }
html.dark .alert-error,
html.dark .alert-danger { color: #fca5a5; border-color: rgba(248,113,113,0.3); }

/* 9) 锚点平滑滚动（跳到评论等）*/
html { scroll-behavior: smooth; }

/* 2) 减少动态偏好：尊重系统「减弱动态效果」，统一收口所有动画/过渡 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    /* 进场动画元素强制可见：JS 会先加 .reveal(opacity:0)，否则会停在隐藏态 */
    .post-card.reveal,
    .comment-item.reveal,
    .ranking-item.reveal { opacity: 1 !important; transform: none !important; }
    /* 图片淡入直接显示，避免停在透明 */
    .post-image.img-init,
    .post-link-preview img.img-init { opacity: 1 !important; }
    /* 持续循环的装饰动画关闭 */
    .empty-state p:first-child { animation: none !important; }
}

/* ===== 活跃度 / 身份 徽章（段位盾牌 + 称号） ===== */
.act-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    vertical-align: middle;
    line-height: 1;
    white-space: nowrap;
}
.act-badge .act-shield {
    position: relative;
    width: 30px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    background: var(--c, #FF6B35); /* 兜底纯色：老浏览器 color-mix 失效时盾牌仍有底色 */
    background: linear-gradient(135deg, var(--c, #FF6B35), color-mix(in srgb, var(--c, #FF6B35) 70%, #000 30%));
    -webkit-clip-path: polygon(50% 0, 100% 18%, 100% 64%, 50% 100%, 0 64%, 0 18%);
    clip-path: polygon(50% 0, 100% 18%, 100% 64%, 50% 100%, 0 64%, 0 18%);
    box-shadow: 0 5px 14px color-mix(in srgb, var(--c, #FF6B35) 45%, transparent);
}
.act-badge .act-meta { display: flex; flex-direction: column; line-height: 1.12; }
.act-badge .act-meta .act-lab { font-size: 10px; color: var(--text-muted, #8a8a8e); font-weight: 700; }
.act-badge .act-meta .act-tier { font-size: 12.5px; font-weight: 800; color: var(--c, #FF6B35); }
.act-badge .act-crown { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 1; }

/* 紧凑模式：列表 / 评论区 */
.act-badge.act-compact {
    gap: 5px;
    padding: 2px 10px 2px 3px;
    border-radius: 100px;
    background: color-mix(in srgb, var(--c, #FF6B35) 14%, transparent);
}
.act-badge.act-compact .act-shield { width: 22px; height: 24px; font-size: 11px; box-shadow: 0 3px 8px color-mix(in srgb, var(--c, #FF6B35) 38%, transparent); }
.act-badge.act-compact .act-tier-inline { font-size: 11.5px; font-weight: 800; color: var(--c, #FF6B35); }
.act-badge.act-compact .act-crown { position: static; transform: none; font-size: 10px; }

/* ===== 用户勋章条（用户名后） ===== */
.medal-strip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
    flex: 0 0 auto;
    white-space: nowrap;
}
.medal-strip .medal-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
    display: block;
    background: rgba(0, 0, 0, .04);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--mr, #8C9BAE) 80%, transparent),
        0 2px 8px color-mix(in srgb, var(--mr, #8C9BAE) 30%, transparent);
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
    z-index: 0;
}
.medal-strip .medal-icon:hover {
    transform: scale(1.22);
    z-index: 2;
    box-shadow:
        0 0 0 2.5px color-mix(in srgb, var(--mr, #8C9BAE) 100%, transparent),
        0 4px 14px color-mix(in srgb, var(--mr, #8C9BAE) 50%, transparent);
}
.medal-strip.medal-strip-compact .medal-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    box-shadow:
        0 0 0 1.5px color-mix(in srgb, var(--mr, #8C9BAE) 75%, transparent),
        0 2px 6px color-mix(in srgb, var(--mr, #8C9BAE) 25%, transparent);
}
.medal-strip.medal-strip-compact .medal-icon:hover {
    transform: scale(1.20);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--mr, #8C9BAE) 100%, transparent),
        0 3px 10px color-mix(in srgb, var(--mr, #8C9BAE) 45%, transparent);
}
.medal-strip .medal-more {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted, #8a8a8e);
    padding: 0 2px;
    line-height: 1;
    letter-spacing: -.3px;
}
html.dark .medal-strip .medal-icon { background: rgba(255, 255, 255, .08); }

/* 勋章悬停/聚焦浮层：放大图 + 名称 + 稀有度 + 文字介绍。
   由 app.js 定位并挂到 <body>（position:fixed），避免被帖子卡片的 overflow:hidden 裁切。 */
.medal-pop {
    position: fixed;
    z-index: 9999;
    width: 240px;
    max-width: calc(100vw - 16px);
    padding: 12px;
    background: var(--card-bg, #fff);
    border: 1px solid color-mix(in srgb, var(--mr, #8C9BAE) 50%, transparent);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    animation: medalPopIn .12s ease;
}
@keyframes medalPopIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}
.medal-pop-head { display: flex; align-items: flex-start; gap: 12px; }
.medal-pop-img {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(0, 0, 0, .04);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mr, #8C9BAE) 70%, transparent);
}
.medal-pop-meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.medal-pop-name {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary, #1a1a1a);
    word-break: break-word;
}
.medal-pop-rarity {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--mr, #8C9BAE);
    background: color-mix(in srgb, var(--mr, #8C9BAE) 15%, transparent);
    padding: 2px 8px;
    border-radius: 6px;
}
.medal-pop-desc { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary, #5c5c5c); }
html.dark .medal-pop { box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
html.dark .medal-pop-img { background: rgba(255, 255, 255, .08); }

/* 分段配色：等级越高越炫 */
.act-badge.tier-bronze { --c: #B08968; }
.act-badge.tier-mint   { --c: #10B981; }
.act-badge.tier-sky    { --c: #38BDF8; }
.act-badge.tier-accent { --c: #7C5CFC; }
.act-badge.tier-amber  { --c: #F59E0B; }
.act-badge.tier-max    { --c: #F59E0B; }

/* 身份徽章配色：管理员 / 编辑 */
.act-badge.tier-admin  { --c: #EF4444; }
.act-badge.tier-editor { --c: #14B8A6; }

/* 满级 L100：彩虹盾牌 + 流光 */
.act-badge.tier-max .act-shield {
    background: linear-gradient(135deg, #FF6B6B, #F59E0B 45%, #7C5CFC);
    box-shadow: 0 6px 16px rgba(245, 158, 11, .45);
    overflow: hidden;
}
.act-badge.tier-max .act-shield::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
    transform: translateX(-120%);
    animation: actShine 2.6s ease-in-out infinite;
}
@keyframes actShine {
    0%, 60% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}


/* =====================================================================
 * 方案 A · 清新 —— 覆盖层
 * 只改视觉（颜色 / 圆角 / 间距 / 阴影 / 层级），不改任何 HTML 结构与交互。
 * 放在文件末尾，同特异度下覆盖前面底稿里的同名规则。
 * ===================================================================== */

/* ---------- 布局宽度 ---------- */
.nav-container,
.app-download-inner,
.main-layout { max-width: 1180px; }
.main-layout { padding: 28px 24px; gap: 28px; }
.sidebar { width: 312px; }

/* ---------- 顶部导航：浅色实底（不用 backdrop-filter，原因见 .navbar 注释） ---------- */
.navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
}
.nav-container { gap: 16px; }
.nav-brand {
    background: var(--logo-chip);
    padding: 5px 10px 5px 8px;
    border-radius: 12px;
}
.nav-brand .nav-logo { height: 30px; max-height: 30px; }
.nav-links { gap: 4px; }
.nav-link,
html.dark .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--nav-text-2);
    padding: 8px 14px;
    border-radius: 10px;
}
.nav-link:hover,
html.dark .nav-link:hover { color: var(--nav-text); background: var(--nav-hover); }
.nav-link.active,
html.dark .nav-link.active { color: var(--accent-text); background: var(--accent-soft); }
.nav-btn,
html.dark .nav-btn {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
}
.nav-btn:hover { background: var(--accent-hover) !important; box-shadow: none; }
.nav-avatar { border: 0; width: 28px; height: 28px; object-fit: cover; }
.admin-link,
html.dark .admin-link { background: var(--rose-soft); color: var(--rose) !important; }

.nsfw-label { color: var(--nav-text-2); font-weight: 700; }
.nsfw-switch { width: 34px; height: 20px; border-radius: 10px; background: var(--switch-off); }
.nsfw-switch.nsfw-on { background: var(--accent); }
.nsfw-knob { width: 16px; height: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.nsfw-switch.nsfw-on .nsfw-knob { transform: translateX(14px); }

.dark-toggle { width: 38px; height: 38px; border-radius: 10px; margin: 0 2px; }
.dark-toggle:hover { background: var(--nav-hover); }
.dark-icon { color: var(--nav-text-2); }
.dark-toggle:hover .dark-icon { color: var(--nav-text); }

.notif-bell { width: 38px; height: 38px; border-radius: 10px; color: var(--nav-text-2); }
.notif-bell:hover,
.notif-bell.active { background: var(--nav-hover); color: var(--nav-text); }
.notif-badge {
    top: 3px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 10.5px;
    background: var(--rose);
    box-shadow: 0 0 0 2px var(--nav-bg);
}

/* 「更多」下拉 */
.nav-more-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}
.nav-more-item { color: var(--text-primary); border-radius: 10px; }
.nav-more-item:hover { background: var(--bg-secondary); color: var(--accent-text); }
.nav-more-ico { color: var(--text-muted); }

/* 移动端菜单 */
.mobile-menu-btn span { background: var(--nav-text); }
.mobile-menu {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}
.mobile-link,
html.dark .mobile-link {
    color: var(--text-primary);
    border-top-color: var(--border-color);
    font-weight: 600;
}
.mobile-link:hover { background: var(--bg-secondary); color: var(--accent-text); }
.mobile-link .mobile-link-ico { color: var(--text-muted); }
.mobile-toggles { border-top-color: var(--border-color); }
.mobile-toggle-item:active { background: var(--bg-secondary); }
.mobile-toggle-label,
.mobile-toggle-icon { color: var(--text-primary); font-weight: 600; }
/* 移动菜单搜索按钮是内联样式写死白字，暗色下绿底需要深色图标 */
.mobile-menu form button[type="submit"] { color: var(--on-accent) !important; }

/* APP 下载提示条 */
.app-download-banner {
    background: var(--banner-bg);
    border-bottom: 1px solid var(--border-color);
}
.app-download-inner { padding: 8px 24px; }
.app-download-copy { color: var(--banner-text); font-size: 13px; }
.app-download-badge { border-radius: 6px; padding: 3px 7px; font-size: 10px; letter-spacing: .06em; }
.app-download-version { color: var(--text-muted); }
.app-download-btn { height: 30px; font-size: 13px; }
.app-download-btn:hover { transform: none; }
.app-download-close { background: transparent; color: var(--text-muted); }
.app-download-close:hover { background: var(--bg-secondary); }

/* ---------- 排序栏：分段控件 ---------- */
.sort-bar {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 16px;
}
.sort-tabs {
    gap: 2px;
    padding: 4px;
    background: var(--seg-bg);
    border-radius: 12px;
}
.sort-tab {
    padding: 8px 16px;
    border-radius: 9px;
    font-weight: 600;
    color: var(--text-secondary);
}
.sort-tab:hover { background: transparent; color: var(--text-primary); }
.sort-tab.active {
    background: var(--seg-active);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}
.current-tag {
    padding: 6px 8px 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
}
.current-tag strong { color: var(--accent-text); }
.remove-tag { color: var(--accent-text); font-size: 14px; }

/* 新帖提示：居中胶囊 */
.new-posts-bar,
html.dark .new-posts-bar {
    width: fit-content;
    margin: -4px auto 14px;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13px;
    box-shadow: 0 8px 24px -8px rgba(22,163,74,.6);
}
.new-posts-bar:hover { box-shadow: 0 10px 28px -8px rgba(22,163,74,.7); }

/* ---------- 帖子卡片 ---------- */
.post-card {
    border-radius: var(--radius-card);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.post-card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    border-color: rgba(22,163,74,.28);
}
.post-card.detail-card:hover { border-color: var(--border-color); box-shadow: var(--shadow); }
.post-header { padding: 18px 22px 10px; }
.post-author { gap: 10px; }
.avatar-sm,
.avatar-placeholder { border-radius: 50%; border: 0; }
.avatar-xs,
.avatar-placeholder-xs { border-radius: 50%; }
.avatar-placeholder,
.avatar-placeholder-xs,
.avatar-placeholder-lg {
    background: var(--accent-soft);
    color: var(--accent-text);
}
.author-name { font-size: 15px; color: var(--text-primary); }
.post-author:hover .author-name { color: var(--accent-text); }
.post-time { font-size: 12.5px; font-weight: 500; }

.post-title { padding: 0 22px 8px; font-size: 18px; letter-spacing: -.01em; }
.post-title a:hover { color: var(--accent-text); }

.post-content,
.post-content-excerpt { padding: 0 22px; margin-bottom: 14px; font-size: 14.5px; line-height: 1.75; }
.post-content a,
.post-content-excerpt a { color: var(--accent-text); }
/* 「查看全文」：行内绿色文字链接，取代原来的胶囊 */
.post-content .read-more-link,
.post-content-excerpt .read-more-link {
    margin-left: 4px;
    padding: 0;
    background: none;
    color: var(--accent-text);
    font-size: 14px;
    font-weight: 700;
}
.post-content .read-more-link:hover,
.post-content-excerpt .read-more-link:hover {
    background: none;
    color: var(--accent-text);
    box-shadow: none;
    transform: none;
    text-decoration: underline;
}

/* 媒体 */
.post-images,
.post-link-preview { padding: 0 22px; }
.post-images.multi { gap: 4px; }
.post-image-wrap { border-radius: 12px; }
.post-images.multi .post-image-wrap { border-radius: 8px; }
.post-image { background: var(--bg-secondary); }
.post-link-preview img { border-radius: 12px; background: var(--bg-secondary); }
.gif-badge {
    top: auto;
    bottom: 8px;
    left: 8px;
    right: auto;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(0,0,0,.6);
    letter-spacing: .04em;
}
.img-more-overlay { background: rgba(0,0,0,.45); }
.nsfw-overlay { background: rgba(0,0,0,.12); }
.nsfw-overlay span {
    background: rgba(0,0,0,.6);
    padding: 9px 18px;
    letter-spacing: .02em;
}

/* 标签 */
.post-tags { padding: 12px 22px 0; gap: 6px; }
.tag-link,
html.dark .tag-link {
    padding: 4px 11px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--tag-bg);
    color: var(--text-secondary);
}
.tag-link:hover,
html.dark .tag-link:hover { background: var(--tag-hover); color: var(--accent-text); }

/* 卡片底栏 */
.post-footer {
    margin-top: 2px;
    padding: 12px 16px 14px;
    border-top: 0;
}
.post-tags + .post-footer,
.post-images + .post-footer { margin-top: 4px; }
.vote-btn,
html.dark .vote-btn {
    border: 0;
    padding: 8px 14px;
    font-size: 14px;
    background: var(--vote-bg);
    color: var(--text-secondary);
}
.vote-btn:hover,
html.dark .vote-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.vote-btn.upvote.voted { background: var(--accent-soft); color: var(--accent-text); }
.vote-btn.upvote.voted svg { fill: currentColor; }
.post-stats { gap: 2px; }
.post-stats .stat-item,
.bookmark-btn-sm,
.report-btn-sm {
    padding: 7px 9px;
    border-radius: 999px;
    font-weight: 600;
    transition: background .2s, color .2s;
}
.post-stats a.stat-item:hover,
.bookmark-btn-sm:hover,
.report-btn-sm:hover { background: var(--bg-secondary); text-decoration: none; }
.bookmark-btn-sm:hover,
.bookmark-btn-sm.bookmarked { color: var(--amber); }
.report-btn-sm { opacity: 1; }
.report-btn-sm:hover { color: var(--rose); }

/* 首页内联评论（样式在 index.php 内，这里只统一底色与圆角） */
.inline-comments { background: var(--inset-bg) !important; border-top-color: var(--border-color) !important; }

/* 外链嵌入卡片 */
.bilibili-embed-card,
.douyin-embed-card { border-radius: 12px; }

/* ---------- 侧边栏 ---------- */
.sidebar-section,
.ranking-tabs-card {
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}
.sidebar-title {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 14px;
    font-size: 15px;
}
.sidebar-title > svg {
    box-sizing: content-box;
    padding: 5px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-text);
}
.sidebar-search-section { padding: 12px !important; }
/* 搜索按钮是内联样式写死白字 */
.sidebar-search-btn { color: var(--on-accent) !important; }

.today-stats .stat-item:hover { background: var(--bg-secondary); }
.today-stats .stat-num {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-primary);
    font-size: 26px;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.today-stats .stat-label { font-weight: 500; }

.signin-summary { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 12px; }
.signin-day { border-radius: 8px; background: var(--bg-secondary); font-weight: 600; }
.signin-day.is-blank { background: transparent; }
.signin-day.is-signed { background: var(--accent-soft); color: var(--accent-text); }
.signin-day.is-today { outline: 2px solid var(--accent); outline-offset: -2px; background: transparent; color: var(--accent-text); }
.signin-day.is-future { opacity: .45; background: transparent; }
.signin-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin-top: 14px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 14px;
    transition: background .2s;
}
.signin-card-link:hover .signin-cta { background: var(--accent-hover); }

.ranking-tabs {
    gap: 2px;
    padding: 3px;
    margin-bottom: 4px;
    border-bottom: 0;
    border-radius: 10px;
    background: var(--seg-bg);
}
.ranking-tab {
    padding: 6px;
    margin-bottom: 0;
    border-bottom: 0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
}
.ranking-tab:hover { color: var(--text-primary); }
.ranking-tab.active {
    background: var(--seg-active);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.ranking-item { font-size: 13.5px; }
.ranking-num,
html.dark .ranking-num {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-muted);
}
.ranking-num.top3,
html.dark .ranking-num.top3 { background: var(--accent-soft); color: var(--accent-text); }
.ranking-item:first-child > .ranking-num.top3 { background: var(--accent); color: var(--on-accent); }
.ranking-name { font-weight: 500; }
.ranking-name:hover { color: var(--accent-text); }
.ranking-count { font-weight: 600; }

.sidebar-tag,
html.dark .sidebar-tag {
    padding: 5px 11px;
    border: 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
}
.sidebar-tag:hover,
html.dark .sidebar-tag:hover,
.sidebar-tag.active { background: var(--accent-soft); color: var(--accent-text); }
.sidebar-tag.active .tag-count { color: inherit; opacity: .6; }
.sidebar-tag-more {
    display: block;
    width: 100%;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px dashed var(--border-strong);
    color: var(--text-muted);
}
.sidebar-tag-more:hover { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }

.post-info .info-row { color: var(--text-muted); }

/* ---------- 按钮 / 表单 ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.btn-primary,
html.dark .btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn-primary:hover,
html.dark .btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); border-color: transparent; box-shadow: none; }
html.dark .btn-success { background: var(--mint); color: var(--on-accent); }
html.dark .btn-danger { background: var(--red); color: #fff; }
.form-input { border-radius: 10px; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

/* ---------- 分页 ---------- */
.page-btn { min-width: 40px; height: 40px; border-radius: 10px; font-weight: 600; }
.page-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.page-btn.active { background: var(--accent); color: var(--on-accent); }
.page-jump-input { border-radius: 10px; }

/* ---------- 详情页 ---------- */
.detail-title { padding: 2px 22px 12px; font-size: 28px; letter-spacing: -.02em; }
.detail-card .post-content,
html.dark .detail-card .post-content { color: var(--text-primary); font-size: 16px; line-height: 1.85; }
.detail-footer { padding: 14px 16px 14px 22px; }
.detail-footer .vote-btn { padding: 10px 20px; font-size: 15px; background: var(--accent); color: var(--on-accent); }
.detail-footer .vote-btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.detail-footer .vote-btn.upvote.voted { background: var(--accent-soft); color: var(--accent-text); }
.bookmark-btn,
.share-btn,
.report-btn {
    border: 0;
    padding: 8px 12px;
    color: var(--text-muted);
    opacity: 1;
}
.bookmark-btn:hover,
.share-btn:hover,
.report-btn:hover { background: var(--bg-secondary); }
.bookmark-btn:hover,
.bookmark-btn.bookmarked { color: var(--amber); }
.share-btn:hover { color: var(--accent-text); }
.report-btn:hover { color: var(--rose); }

.section-title {
    padding-bottom: 0;
    margin-bottom: 16px;
    border-bottom: 0;
    font-size: 18px;
    letter-spacing: -.01em;
}
.section-title > svg { color: var(--accent-text); }

.comments-section {
    padding: 22px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.comment-form {
    padding: 12px;
    border-radius: 14px;
    background: var(--inset-bg);
    border: 1px solid var(--border-color);
    transition: border-color .2s, box-shadow .2s;
}
.comment-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment-input-wrap .avatar-sm { width: 36px; height: 36px; }
.comment-input-wrap textarea,
html.dark .comment-input-wrap textarea {
    padding: 6px 4px;
    border: 0;
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
}
.comment-input-wrap textarea:focus { border: 0; box-shadow: none; }
.emoji-toggle-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
}
.emoji-toggle-btn:hover { background: var(--bg-secondary); color: var(--accent-text); }
.emoji-panel { border-radius: 14px; box-shadow: var(--shadow-lg); }
.emoji-tab-btn { border-radius: 8px 8px 0 0; }

.comment-item { gap: 12px; padding: 16px 0 8px; }
.comment-item.depth-1,
.comment-item.depth-2,
.comment-item.depth-3,
.comment-item.depth-4,
.comment-item.depth-5 { border-left-color: var(--border-color); padding-left: 14px; }
.comment-author { font-size: 14px; }
.comment-time { font-weight: 500; }
.comment-text { color: var(--text-primary); font-size: 15px; line-height: 1.7; }
.reply-btn,
.comment-action-btn { font-weight: 600; }
.reply-btn:hover { color: var(--text-primary); background: var(--bg-secondary); }
.comment-action-btn:hover { background: var(--bg-secondary); }
.comment-vote-btn { border-radius: 999px; padding: 4px 8px; font-size: 13px; }
.comment-vote-btn:hover { background: var(--bg-secondary); }
.comment-vote-btn.voted .comment-vote-icon { fill: currentColor; }
.reply-form textarea,
.edit-textarea { border-width: 1px; border-radius: 10px; }
.reply-form textarea:focus,
.edit-textarea:focus { box-shadow: 0 0 0 3px var(--accent-soft); }

.related-posts-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.related-posts-section .section-title { font-size: 18px; font-weight: 800; }
.related-post-card { border-radius: 12px; background: var(--bg-secondary); }
.related-post-card:hover { box-shadow: var(--shadow-md); }
.related-title { font-weight: 600; }

/* ---------- 通知面板 ---------- */
.notif-panel { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.notif-tab:hover { color: var(--text-primary); }
.notif-item-avatar,
.notif-item-avatar-ph { border-radius: 50%; }
.notif-item-avatar-ph { background: var(--accent-soft); color: var(--accent-text); }
.notif-item:hover { background: var(--bg-secondary); }

/* ---------- 页脚 / 回到顶部 ---------- */
.site-footer,
html.dark .site-footer {
    background: transparent;
    font-weight: 500;
}
.site-footer .footer-links a { color: var(--text-secondary); }
.site-footer .footer-links a:hover { color: var(--accent-text); text-decoration: none; }
.back-to-top {
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}
.back-to-top:hover {
    background: var(--accent);
    color: var(--on-accent);
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}

/* ---------- 其他 ---------- */
.content-ad { border-radius: var(--radius-card); }
.confetti-check { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 28px rgba(22,163,74,.45); }
.comment-history-item::before { background: var(--accent); }
.progress-fill { background: var(--accent); }
/* 联系页顶部横幅是页面内联样式写死白字：暗色模式主色较亮，横幅改用深一档的绿保证白字可读 */
html.dark .contact-fb-hero { background: linear-gradient(135deg, #16A34A, #15803D); box-shadow: none; }

/* ---------- 手机端（≤768px） ---------- */
@media (max-width: 768px) {
    .main-layout { padding: 12px 16px 32px; gap: 12px; }
    .sort-bar { margin-bottom: 12px; }
    .sort-tab { padding: 8px 4px; border-radius: 9px; }
    .new-posts-bar { margin-bottom: 12px; }

    /* 信息流贴满屏幕宽度，卡片之间留浅灰间隔（接近原生 APP） */
    .content-area > .post-list { margin-left: -16px; margin-right: -16px; }
    .content-area > .post-list > .post-card {
        margin-bottom: 8px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }
    .content-area > .detail-card,
    .content-area > .comments-section,
    .content-area > .related-posts-section {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .post-header { padding: 14px 16px 8px; }
    .avatar-sm,
    .avatar-placeholder { width: 36px; height: 36px; }
    .author-name { font-size: 14.5px; }
    .post-title { padding: 0 16px 6px; font-size: 16.5px; }
    .post-content,
    .post-content-excerpt { padding: 0 16px; font-size: 14.5px; }
    .post-images,
    .post-link-preview { padding: 0 16px; }
    .post-tags { padding: 10px 16px 0; }
    .post-footer { padding: 8px 10px 10px; }
    .vote-btn { padding: 7px 12px; font-size: 13.5px; }

    .detail-title { padding: 0 16px 10px; font-size: 21px; }
    .detail-card .post-content { padding: 0 16px; font-size: 15.5px; }
    .detail-footer { padding: 10px 12px 12px 16px; }
    .comments-section { padding: 16px; }

    .sidebar-section,
    .ranking-tabs-card { border-radius: 16px; margin-bottom: 12px; }

    .back-to-top { width: 40px; height: 40px; right: 14px; bottom: 18px; }
}
@media (max-width: 480px) {
    .post-title { font-size: 16.5px; }
}


/* =====================================================================
 * 方案 A · 清新 —— 第二步：布局调整（配合 header.php / detail.php 新结构）
 *   顶栏常驻搜索、头像下拉、手机端顶栏图标 + 菜单重排、详情页面包屑
 * ===================================================================== */

/* ---------- 顶栏搜索 ---------- */
.nav-container { justify-content: flex-start; }
.nav-search {
    flex: 1 1 220px;
    min-width: 140px;
    max-width: 380px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 14px;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    color: var(--nav-text-2);
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.nav-search:focus-within {
    background: var(--card-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.nav-search svg { flex-shrink: 0; }
.nav-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--nav-text);
}
.nav-search input::placeholder { color: var(--nav-text-2); opacity: .85; }
.nav-search input::-webkit-search-cancel-button { cursor: pointer; }
.nav-search kbd {
    font: 600 11px/1 var(--font-base);
    padding: 4px 7px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    color: var(--nav-text-2);
}
.nav-search:focus-within kbd { display: none; }
.nav-links { margin-left: auto; }

/* 顶栏有了常驻搜索，桌面端侧栏的搜索卡片就重复了；手机端顶栏没有搜索框，侧栏保留 */
@media (min-width: 769px) {
    .sidebar .sidebar-search-section { display: none !important; }
}

/* ---------- 发布按钮 ---------- */
.nav-link.nav-publish { gap: 4px; padding: 8px 16px 8px 12px; margin-left: 4px; }

/* ---------- 头像下拉 ---------- */
.nav-user { position: relative; display: inline-flex; align-items: center; }
.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 8px 0 4px;
    margin-left: 2px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--nav-text-2);
    font: inherit;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.nav-user-btn:hover,
.nav-user.open .nav-user-btn,
.nav-user-btn.active { background: var(--nav-hover); color: var(--nav-text); }
.nav-user-btn .nav-avatar { width: 30px; height: 30px; margin: 0; }
.nav-avatar-ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 700;
}
.nav-user-name {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--nav-text);
}
.nav-user-caret { transition: transform .15s ease; }
.nav-user.open .nav-user-caret { transform: rotate(180deg); }
.nav-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.nav-user.open .nav-user-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .16s ease, transform .16s ease, visibility 0s;
}
@media (prefers-reduced-motion: reduce) { .nav-user-menu { transition: none; transform: none; } }
.nav-menu-sep { height: 1px; margin: 6px 4px; background: var(--border-color); }
.nav-more-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.nav-more-ico svg { width: 16px; height: 16px; }

@media (max-width: 1080px) {
    .nav-user-name { display: none; }
    .nav-search { max-width: 260px; }
}
@media (max-width: 920px) {
    .nav-search kbd,
    .nsfw-label { display: none; }
    .nav-link { padding: 8px 10px; }
}

/* ---------- 手机端顶栏 ---------- */
.nav-mobile-actions { display: none; margin-left: auto; align-items: center; gap: 2px; }
.nav-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--nav-text-2);
    cursor: pointer;
}
.nav-icon-btn:hover,
.nav-icon-btn:active { background: var(--nav-hover); color: var(--nav-text); }
.nav-mobile-actions .mobile-menu-btn { min-width: 40px; min-height: 40px; padding: 0; border-radius: 10px; gap: 4px; }
.nav-mobile-actions .mobile-menu-btn span { width: 18px; height: 2px; }

@media (max-width: 768px) {
    .nav-container { height: 56px; padding: 0 8px 0 16px; gap: 8px; }
    .nav-search { display: none; }
    .nav-mobile-actions { display: flex; }
    .nav-brand .nav-logo { height: 28px; max-height: 28px; }

    /* ---------- 手机端菜单 ---------- */
    .mobile-menu.active { padding-bottom: 12px; }
    .mobile-menu > * { margin-left: 16px; margin-right: 16px; }
    .mobile-search {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 44px;
        margin-top: 14px;
        padding: 0 4px 0 14px;
        border-radius: 999px;
        background: var(--bg-secondary);
        border: 1px solid transparent;
        color: var(--text-muted);
    }
    .mobile-search:focus-within { border-color: var(--accent); background: var(--card-bg); }
    .mobile-search input {
        flex: 1;
        min-width: 0;
        height: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        font: inherit;
        font-size: 16px; /* <16px 时 iOS Safari 聚焦会自动放大页面 */
        color: var(--text-primary);
    }
    .mobile-search-btn {
        flex-shrink: 0;
        height: 36px;
        padding: 0 16px;
        border: 0;
        border-radius: 999px;
        background: var(--accent);
        color: var(--on-accent);
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
    }

    .mobile-user {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 12px;
        padding: 10px 10px 10px 12px;
        border-radius: 14px;
        background: var(--inset-bg);
        border: 1px solid var(--border-color);
    }
    .mobile-user-link {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--text-primary);
        text-decoration: none;
    }
    .mobile-user-link:hover { text-decoration: none; }
    .mobile-user .nav-avatar { width: 40px; height: 40px; margin: 0; font-size: 16px; }
    .mobile-user-text { display: flex; flex-direction: column; min-width: 0; }
    .mobile-user-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-user-sub { font-size: 12px; color: var(--text-muted); }
    .mobile-publish { flex-shrink: 0; gap: 4px; }

    .mobile-links { display: grid; grid-template-columns: 1fr; margin-top: 8px; }
    .mobile-link,
    html.dark .mobile-link {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 46px;
        padding: 0 8px;
        border-top: 0;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
    }
    .mobile-link:hover { background: var(--bg-secondary); color: var(--text-primary); }
    .mobile-link-svg { flex-shrink: 0; color: var(--text-muted); }
    .mobile-link.active,
    .mobile-link.active .mobile-link-svg { color: var(--accent-text); }
    .mobile-badge {
        margin-left: auto;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 10px;
        background: var(--rose);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        line-height: 20px;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-sep { height: 1px; margin-top: 6px; margin-bottom: 6px; background: var(--border-color); }
    .mobile-links-ext { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
    .mobile-link-ext,
    html.dark .mobile-link-ext {
        min-height: 44px;
        gap: 10px;
        padding: 0 10px;
        background: var(--bg-secondary);
        font-size: 14px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .mobile-link-ico {
        width: 26px;
        height: 26px;
        border-radius: 7px;
        background: var(--card-bg);
        color: var(--text-secondary);
    }
    .mobile-link-ico svg { width: 16px; height: 16px; }

    .mobile-toggles {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 10px;
        border-top: 0;
    }
    .mobile-toggle-item {
        min-height: 44px;
        padding: 0 12px;
        border-radius: 10px;
        background: var(--bg-secondary);
    }
    .mobile-toggle-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
    .mobile-toggles .mobile-toggle-item:only-child { grid-column: 1 / -1; }
    html.dark .dark-switch { background: var(--accent); }
    html.dark .dark-switch .nsfw-knob { transform: translateX(14px); }

    .mobile-logout,
    html.dark .mobile-logout { margin-top: 6px; color: var(--text-muted); }
}

/* ---------- 详情页面包屑 ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0 4px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
.breadcrumb a { flex-shrink: 0; color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-text); text-decoration: none; }
.breadcrumb-sep { flex-shrink: 0; opacity: .6; }
.breadcrumb-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) {
    .breadcrumb { margin: 0 0 10px; font-size: 12.5px; }
}
