/* =========================================================
   论坛样式表
   结构：
     1. 全局变量与基础
     2. 按钮
     3. 导航栏
     4. 搜索弹层
     5. 卡片与表单
     6. 帖子列表
     7. 徽章
     8. 操作栏
     9. 详情页底部
     10. 回复区
     11. 富文本
     12. 分页
     13. 模态框
     14. 内容筛选 Tab
     15. 通知中心
     16. 相关推荐
     17. 返回顶部
     18. 我的页面
     19. 安全设置
     20. 收藏按钮
     21. 隐藏内容
     22. 等级系统
     23. 帖子 meta 区
     24. 关键词锚文本
     25. 表格响应式
     26. Footer
     27. 移动端（统一媒体查询）
   ========================================================= */

/* =========================================================
   1. 全局变量与基础
   ========================================================= */
:root {
    --primary: #1f2937;
    --secondary: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f3f4f6;
    --border: #e5e7eb;

    --guanli: #8b5cf6;
    --fatie: #f59e0b;
    --wode: #06b6d4;
    --tongzhi: #ec4899;
    --tuichu: #dc2626;

    font-size: 16px;
}

@media (min-width: 768px) {
    :root { font-size: 17px; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
                 sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    background: var(--bg);
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

h2, h3 { color: var(--primary); margin-top: 0; }

.hidden { display: none; }

/* =========================================================
   2. 按钮
   ========================================================= */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--secondary);
    color: #fff;
    transition: background 0.2s, opacity 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.btn:hover { opacity: 0.9; }

.btn-primary { background: var(--secondary); color: #fff; }
.btn-danger { background: var(--danger); }
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    line-height: 1.4;
    border-radius: 4px;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}
.btn-outline:hover { background: var(--secondary); color: #fff; }

a.btn, button.btn {
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 语义化按钮变体 */
.btn-guanli { background: var(--guanli); color: #fff; }
.btn-guanli:hover { background: #7c3aed; }
.btn-fatie { background: var(--fatie); color: #fff; }
.btn-fatie:hover { background: #d97706; }
.btn-wode { background: var(--wode); color: #fff; }
.btn-wode:hover { background: #0891b2; }
.btn-tongzhi { background: var(--tongzhi); color: #fff; }
.btn-tongzhi:hover { background: #db2777; }
.btn-tuichu { background: var(--tuichu); color: #fff; }
.btn-tuichu:hover { background: #b91c1c; }

/* =========================================================
   3. 导航栏
   ========================================================= */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.user-info-desktop { display: flex; align-items: center; gap: 1rem; }
.user-info-mobile { display: none !important; }

/* 汉堡按钮 */
.hamburger-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 1.2rem;
    line-height: 1;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.hamburger-btn:hover { background: #f5f5f5; border-color: #ccc; }
.hamburger-btn:active { background: #ececec; }

.hamburger-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

/* 移动端下拉菜单 */
.mobile-menu {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: #fff;
    border-bottom: 1px solid #e1e4e8;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}
.mobile-menu.active { max-height: 400px; }
.mobile-menu-content { padding: 8px 0; }
.mobile-menu-welcome {
    padding: 10px 20px;
    color: #888;
    font-size: 0.85rem;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}
.mobile-menu-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    color: #333;
    font-size: 0.95rem;
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.mobile-menu-item:hover { background: #f5f5f5; }
.mobile-menu-item:active { background: #ececec; }
.mobile-menu-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }
.mobile-menu-form { margin: 0; }
.mobile-menu-logout { color: #e74c3c; }
.mobile-menu-badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    background: #e74c3c;
    color: #fff;
    border-radius: 10px;
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.4;
}
.mobile-menu-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
   4. 搜索弹层
   ========================================================= */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.search-overlay.active { display: flex; }
.search-overlay-content {
    background: #fff;
    padding: 30px 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.search-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
.search-overlay-content h3 { margin-top: 0; text-align: center; }
.search-overlay-content input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 10px;
}
.search-overlay-content button {
    width: 100%;
    padding: 12px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.search-hl {
    background: #fff3b8;
    color: #7a5a00;
    border-radius: 2px;
    font-weight: 600;
}

/* =========================================================
   5. 卡片与表单
   ========================================================= */
.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}
textarea { min-height: 100px; resize: vertical; }
.form-container { max-width: 400px; margin: 2rem auto; }

.alert { padding: 1rem; border-radius: 4px; margin-bottom: 1rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* =========================================================
   6. 帖子列表
   ========================================================= */
.post-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}
.post-item:last-child { border-bottom: none; margin-bottom: 0; }

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.post-title a { color: inherit; text-decoration: none; }
.post-title a:hover { color: var(--secondary); }

.view-title { font-size: 1.2rem; }

.post-content { margin: 1rem 0; white-space: pre-wrap; }
.post-summary { color: #555; }

.pinned-post { background: #fffef5; }

/* =========================================================
   7. 徽章（精华 / 置顶 / 锁定 / 未读 / 标签）
   ========================================================= */
.badge-featured-icon,
.badge-pinned-icon,
.badge-locked {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: 1.6;
    margin-right: 5px;
    vertical-align: 2px;
    white-space: nowrap;
    user-select: none;
}
.badge-featured-icon { background: #f59e0b; color: #fff; }
.badge-pinned-icon { background: #6366f1; color: #fff; }
.badge-locked { background: #95a5a6; color: #fff; }

.badge-unread {
    background: #e74c3c;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 3px;
    display: inline-block;
    line-height: 1;
}

.tag-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin: 2px;
    text-decoration: none;
}
.tag-badge:hover { background: #d2e3fc; }

/* =========================================================
   8. 列表页 / 详情页操作栏
   ========================================================= */
.post-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.admin-action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.admin-action-buttons form { margin: 0; }

.post-actions-divider {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eef0f3;
}

.board-link {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.board-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* =========================================================
   9. 详情页底部区域（标签区 + 操作区）
   ========================================================= */
.post-tags-section {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.post-tags-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    user-select: none;
}
.post-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}
.tag-link {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.6;
    transition: color 0.15s;
}
.tag-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}
.tag-sep {
    color: #ccc;
    font-size: 0.85rem;
    user-select: none;
}
.post-actions-bottom {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

/* =========================================================
   10. 回复区
   ========================================================= */
.reply-list {
    margin-top: 0.8rem;
    padding-left: 0;
    border-left: none;
}
.reply-item {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fdfcff;
    border: 1px solid #f0ecf7;
    border-radius: 10px;
    transition: background 0.15s, border-color 0.15s;
}
.reply-item:hover {
    background: #faf8ff;
    border-color: #e8e0f2;
}
.reply-item:last-child { margin-bottom: 0; }

.reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.reply-floor {
    font-size: 0.8rem;
    font-weight: 600;
    color: #a89bb5;
    flex-shrink: 0;
    white-space: nowrap;
}
.reply-username {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}
.reply-meta {
    font-size: 0.75rem;
    color: #b3a8be;
    white-space: nowrap;
}
.reply-meta::before {
    content: '·';
    margin-right: 5px;
    color: #d5cce0;
}

.reply-content {
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.7;
}
.reply-content p {
    margin: 0 !important;
    padding: 0 !important;
}
.reply-content p + p {
    margin-top: 0.3em !important;
}

.reply-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ede8f5;
    flex-wrap: wrap;
}
.reply-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: 0;
}
.reply-actions .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-height: 26px;
    padding: 0 10px;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 4px;
    box-sizing: border-box;
    vertical-align: middle;
    white-space: nowrap;
}

/* 回复区引用块 */
.reply-item blockquote {
    border-left: 3px solid #ccc !important;
    padding: 6px 10px !important;
    margin: 0 0 6px 0 !important;
    background: #f9f9f9 !important;
    color: #666 !important;
}
.reply-item hr {
    border: none !important;
    border-top: 1px solid #e0e0e0 !important;
    margin: 6px 0 !important;
}

/* =========================================================
   11. 富文本内容
   ========================================================= */
.rich-content { line-height: 1.8; word-wrap: break-word; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4, .rich-content h5, .rich-content h6 {
    margin: 1.5em 0 0.75em;
    line-height: 1.3;
    color: var(--primary);
    font-weight: 600;
}
.rich-content h1 { font-size: 1.5em; border-bottom: 2px solid #ddd; padding-bottom: 0.3em; }
.rich-content h2 { font-size: 1.3em; border-bottom: 1px solid #eee; padding-bottom: 0.25em; }
.rich-content h3 { font-size: 1.2em; }
.rich-content h4 { font-size: 1.1em; }
.rich-content h5 { font-size: 1em; }
.rich-content h6 { font-size: 0.9em; color: #555; }

.rich-content p { margin: 0.4em 0; line-height: 1.7; }
.rich-content a {
    color: var(--secondary);
    text-decoration: none;
    border-bottom: 1px dashed var(--secondary);
    transition: all 0.2s;
}
.rich-content a:hover { color: #1d6fa5; border-bottom-style: solid; }
.rich-content ul, .rich-content ol { margin: 0.8em 0; padding-left: 2em; }
.rich-content ul { list-style-type: disc; }
.rich-content ol { list-style-type: decimal; }
.rich-content li { margin-bottom: 0.3em; }
.rich-content blockquote {
    margin: 1em 0;
    padding: 0.8em 1em;
    border-left: 4px solid var(--secondary);
    background: #f7f9fa;
    color: #555;
    border-radius: 0 4px 4px 0;
}
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: block;
    margin: 0 auto;
}
.rich-content code {
    background: #f0f2f4;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #c7254e;
}
.rich-content pre {
    background: #f6f8fa;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #e1e4e8;
    margin: 1em 0;
}
.rich-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.rich-content th, .rich-content td { border: 1px solid #ddd; padding: 0.5em 0.8em; text-align: left; }
.rich-content th { background: #f0f2f4; font-weight: 600; }
.rich-content hr { border: none; border-top: 1px solid #ddd; margin: 2em 0; }

/* =========================================================
   12. 分页（柔和胶囊风）
   ========================================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: #888;
    background: transparent;
    font-size: 0.8rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pagination a:hover {
    color: var(--secondary);
    border-color: var(--secondary);
    background: transparent;
}
.pagination .current {
    background: #fff;
    color: var(--secondary);
    border-color: var(--secondary);
    font-weight: 500;
}

/* =========================================================
   13. 模态框
   ========================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal-close {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

/* =========================================================
   14. 内容筛选 Tab
   ========================================================= */
.content-filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.content-filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}
.filter-tab:hover { color: var(--secondary); }
.filter-tab.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    font-weight: 600;
}
.tab-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    background: #6366f1;
    color: #fff;
    border-radius: 9px;
    font-size: 0.7rem;
    line-height: 1.3;
    text-align: center;
    font-weight: normal;
}

/* =========================================================
   15. 通知中心
   ========================================================= */
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.notif-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.notif-header-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #e74c3c;
    color: #fff;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: normal;
}
.notif-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
}

.notif-card {
    position: relative;
    padding: 14px 18px;
    border-radius: 8px;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
.notif-card:hover {
    background: #f3f5f8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.notif-card.notif-unread {
    background: #f0f5ff;
    border-color: #d6e4ff;
}
.notif-card.notif-unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #6366f1;
}
.notif-card.notif-unread:hover { background: #e8f0ff; }
.notif-card.notif-read { opacity: 0.75; }
.notif-card.notif-read:hover { opacity: 1; }

.notif-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.notif-title-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.notif-icon { font-size: 1rem; flex-shrink: 0; }
.notif-type {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-time {
    font-size: 0.75rem;
    color: #999;
    flex-shrink: 0;
}
.notif-thread-title {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-summary {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}
.notif-count { font-size: 0.75rem; color: #999; }

.notif-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.notif-card:hover .notif-delete-btn { opacity: 1; }
.notif-delete-btn button {
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    color: #999;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.notif-delete-btn button:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* 通知主题变体：管理员通知（浅金） */
.notif-card.notif-admin {
    background: #fffaef;
    border-color: #f5e6c8;
}
.notif-card.notif-admin.notif-unread {
    background: #fff5dc;
    border-color: #ecd5a0;
}
.notif-card.notif-admin.notif-unread::before { background: #f59e0b; }
.notif-card.notif-admin:hover {
    background: #fff8e8;
    border-color: #ecd5a0;
}
.notif-card.notif-admin .notif-summary {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    white-space: pre-line;
    max-height: 320px;
    overflow-y: auto;
    color: #7a5a20;
    line-height: 1.7;
}

/* 通知主题变体：欢迎通知（浅绿） */
.notif-card.notif-welcome {
    background: #f0faf4;
    border-color: #c5e8d3;
}
.notif-card.notif-welcome.notif-unread {
    background: #e6f6ec;
    border-color: #a8d8bc;
}
.notif-card.notif-welcome.notif-unread::before { background: #10b981; }
.notif-card.notif-welcome:hover {
    background: #eaf7ef;
    border-color: #a8d8bc;
}
.notif-card.notif-welcome .notif-summary {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    white-space: pre-line;
    max-height: 320px;
    overflow-y: auto;
    color: #2c5a3e;
    line-height: 1.7;
}

/* =========================================================
   16. 相关推荐列表
   ========================================================= */
.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li { padding: 8px 0; border-bottom: 1px solid #eee; }
.related-list li:last-child { border-bottom: none; }
.related-list a { text-decoration: none; color: var(--primary); }
.related-list a:hover { color: var(--secondary); }

/* =========================================================
   17. 返回顶部按钮
   ========================================================= */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 150px;
    width: 42px;
    height: 42px;
    border: 1px solid #e1e4e8;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #888;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.15s, color 0.15s;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: #fff;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.back-to-top:active { transform: scale(0.95); }

/* =========================================================
   18. "我的"页面
   ========================================================= */
.my-page-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0 0 15px;
    padding: 0;
    font-weight: bold;
}
.my-list-item { margin-bottom: 15px; }
.my-list-item:last-child { margin-bottom: 0; }
.my-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.post-locked-hint {
    color: #aaa;
    font-size: 0.8rem;
    align-self: center;
}

/* =========================================================
   19. 安全设置
   ========================================================= */
.security-card { margin-bottom: 15px; }
.security-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: var(--primary);
}
.security-card p {
    margin: 0.5em 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}
.security-card form { margin-top: 12px; }
.security-card-danger {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
}
.security-card-danger h4 { color: #c0392b; }

.totp-code-input {
    width: 100%;
    padding: 10px;
    font-size: 1.05rem;
    letter-spacing: 2px;
    text-align: center;
}

/* =========================================================
   20. 收藏按钮
   ========================================================= */
#favorite-btn.favorited {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
#favorite-btn.favorited:hover {
    background: #fde68a;
    color: #78350f;
    border-color: #fcd34d;
}
#favorite-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
#favorite-btn.limit-reached {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* =========================================================
   21. 隐藏内容（会员可见）
   ========================================================= */
.hide-content { display: block; }

.hide-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 16px;
    margin: 12px 0;
    background: #f8f9fb;
    border: 1px dashed #cbd5e0;
    border-radius: 6px;
    color: #718096;
    font-size: 0.92rem;
    text-align: center;
    user-select: none;
}
.hide-placeholder .hide-icon {
    font-size: 1.1rem;
    line-height: 1;
}
.hide-placeholder .hide-text { line-height: 1.5; }
.hide-placeholder a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--secondary);
    padding-bottom: 1px;
}
.hide-placeholder a:hover {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

/* =========================================================
   22. 等级系统
   ========================================================= */

/* 等级标签（通用） */
.user-level-tag {
    display: inline-block;
    font-size: 0.78em;
    color: #8b7ba0;
    background: #f5f0fa;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.6;
    vertical-align: middle;
    white-space: nowrap;
    font-weight: normal;
    cursor: default;
}

/* 个人主页等级卡片 */
.my-level-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fdf8ff 0%, #f0e8fa 100%);
    border: 1px solid #ead9f5;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(139, 123, 160, 0.06);
}
.my-level-icon {
    flex-shrink: 0;
    font-size: 2.2rem;
    line-height: 1;
    user-select: none;
}
.my-level-body {
    flex: 1;
    min-width: 0;
}
.my-level-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #6d5a85;
    margin-bottom: 8px;
}
.my-level-progress {
    position: relative;
    height: 8px;
    background: #ebdff5;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.my-level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c8a2c8 0%, #ddb8e0 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.my-level-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: #9a8aab;
    flex-wrap: wrap;
}
.my-level-motto {
    font-style: italic;
    color: #b3a0c4;
}

/* =========================================================
   23. 帖子 meta 区（作者信息 + 元数据）
   ========================================================= */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.8;
}
.meta-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.meta-username {
    font-weight: 500;
    color: #555;
}
.meta-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #999;
    font-size: 0.92em;
}
.meta-sep {
    color: #d0c8d8;
    user-select: none;
}

/* =========================================================
   24. 关键词锚文本
   ========================================================= */
.keyword-link {
    color: var(--secondary);
    text-decoration: none;
    border-bottom: 1px dashed var(--secondary);
    transition: color 0.15s, border-color 0.15s;
}
.keyword-link:hover {
    color: #4f46e5;
    border-bottom-style: solid;
    border-bottom-color: #4f46e5;
}

/* =========================================================
   25. 表格响应式
   ========================================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.user-table { min-width: 100%; }
.user-table th,
.user-table td { white-space: nowrap; }

/* =========================================================
   26. Footer
   ========================================================= */
.site-footer {
    text-align: center;
    margin-top: 2.5rem;
    padding: 1.5rem 20px 1.8rem;
    background: #f1f1f1;
    font-size: 0.85rem;
    color: #888;
    line-height: 1.9;
}
.footer-text { margin: 6px 0; }
.footer-beian {
    color: #a0a0a0;
    font-size: 0.82rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #dfdfdf;
}
.footer-links-label {
    color: #999;
    font-size: 0.85rem;
    font-weight: 500;
}
.footer-links-label::after {
    content: '·';
    margin-left: 8px;
    color: #ccc;
}
.footer-links-list {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.footer-link {
    display: inline-block;
    padding: 3px 10px;
    color: #777;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 12px;
    background: transparent;
    transition: color 0.15s, background 0.15s;
}
.footer-link:hover {
    color: var(--secondary);
    background: rgba(99, 102, 241, 0.08);
}

.footer-debug {
    margin: 8px 0 0;
    color: #b0b0b0;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}
.footer-debug-sep {
    color: #ccc;
    margin: 0 8px;
}

/* =========================================================
   27. 移动端（统一媒体查询 ≤768px）
   ========================================================= */
@media (max-width: 768px) {

    /* ---- 27.1 Navbar ---- */
    .navbar .container {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
    }
    .brand {
        text-align: left !important;
        margin-bottom: 0 !important;
        font-size: 1.2rem !important;
        flex-shrink: 0;
    }

    /* ---- 27.2 用户区切换 ---- */
    .user-info-desktop { display: none !important; }
    .user-info.user-info-mobile {
        display: flex !important;
        align-items: center;
        gap: 5px;
        flex-wrap: nowrap;
    }
    .user-info-mobile .btn,
    .user-info-mobile .hamburger-btn {
        height: 28px;
        min-height: 28px;
        padding: 0 9px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        font-size: 0.75rem;
        line-height: 1;
        border-radius: 3px;
        vertical-align: middle;
        margin: 0;
    }
    .user-info-mobile .hamburger-btn {
        width: 28px;
        padding: 0;
        font-size: 0.9rem;
        color: #666;
        border-color: #e1e4e8;
        background: #fafbfc;
    }
    .user-info-mobile .hamburger-btn:hover {
        background: #f0f0f0;
        color: #333;
    }

    /* ---- 27.3 下拉菜单启用 ---- */
    .mobile-menu { display: block; }

    /* ---- 27.4 通知中心 ---- */
    .notif-delete-btn { opacity: 1; }
    .notif-card { padding: 12px 14px; }
    .notif-list { gap: 12px; padding-bottom: 16px; }

    /* ---- 27.5 操作栏紧凑化 ---- */
    .post-actions-divider { gap: 5px; }
    .post-actions-divider .btn-sm,
    .post-actions-bar .btn-sm {
        padding: 4px 9px;
        font-size: 0.75rem;
    }
    .admin-action-buttons { gap: 5px; }

    /* ---- 27.6 详情页底部按钮 ---- */
    .post-footer-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .post-footer-actions .btn-sm {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    /* ---- 27.7 返回顶部 ---- */
    .back-to-top {
        right: 15px;
        bottom: 130px;
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    /* ---- 27.8 我的页面 ---- */
    .my-page-title { font-size: 1.3rem; margin-bottom: 12px; }
    .filter-tab { padding: 8px 10px; font-size: 1rem; }
    .tab-badge { min-width: 16px; padding: 0 4px; font-size: 0.65rem; }
    .my-list-item { margin-bottom: 12px; }
    .security-card h4 { font-size: 1rem; }

    /* ---- 27.9 回复区 ---- */
    .reply-item {
        padding: 12px 14px;
        margin-bottom: 10px;
        border-radius: 8px;
    }
    .reply-header { gap: 6px; margin-bottom: 6px; }
    .reply-floor { font-size: 0.75rem; }
    .reply-username { font-size: 0.88rem; }
    .reply-meta { font-size: 0.72rem; color: #b3a8be; }
    .reply-actions { gap: 5px; margin-top: 8px; padding-top: 8px; }
    .reply-actions .btn-sm {
        height: 24px;
        min-height: 24px;
        padding: 0 8px;
        font-size: 0.72rem;
    }
    .reply-content { font-size: 0.9rem; }

    /* ---- 27.10 分页 ---- */
    .pagination { gap: 5px; margin-top: 14px; }
    .pagination a,
    .pagination span {
        min-width: 26px;
        height: 25px;
        padding: 0 8px;
        font-size: 0.75rem;
        border-radius: 13px;
    }

    /* ---- 27.11 等级卡片 ---- */
    .my-level-card {
        padding: 12px 14px;
        gap: 10px;
        border-radius: 10px;
    }
    .my-level-icon { font-size: 1.8rem; }
    .my-level-title { font-size: 0.95rem; margin-bottom: 6px; }
    .my-level-meta { font-size: 0.72rem; }

    /* ---- 27.12 Footer ---- */
    .site-footer {
        padding: 1.2rem 16px 1.5rem;
        margin-top: 2rem;
        font-size: 0.8rem;
    }
    .footer-links {
        gap: 6px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    .footer-links-label,
    .footer-link { font-size: 0.8rem; }
    .footer-link { padding: 2px 8px; }
}

/* =========================================================
   28. 窄屏优化（≤600px，帖子 meta 区）
   ========================================================= */
@media (max-width: 600px) {
    .post-meta {
        font-size: 0.78rem;
        gap: 3px 6px;
    }
    .meta-author { gap: 5px; }
    .meta-info { gap: 3px; }
    .post-meta .user-level-tag {
        font-size: 0.7em;
        padding: 0 6px;
    }
}
@media (min-width: 1024px) {
    body.admin-page .container {
        max-width: 1200px;
    }
}