﻿/* ============================================================
   FAV+  - 主样式表
   ============================================================ */

/* ========== 主题变量 ========== */
:root {
    /* 背景 */
    --bg-primary: #0f172a;
    --bg-secondary: #131c33;
    --bg-tertiary: #18223f;

    --bg-card: #162033;
    --bg-card-hover: #1b2740;

    --bg-input: #111827;
    --bg-modal: #162033;

    /* 边框 */
    --border: #25324d;
    --border-hover: #34456a;

    /* 文字 */
    --text-logo: #e5e7eb;
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* FAV+主色 */
    --accent: #7c8cff;
    --accent-hover: #6d7dff;

    --accent-bg: rgba(124, 140, 255, 0.12);
    --accent-glow: rgba(124, 140, 255, 0.25);

    /* 功能色 */
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.25);
    --shadow-md: 0 6px 20px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.45);

    --shadow-glow: 0 0 24px var(--accent-glow);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 28px;

    --nav-height: 56px;
    --max-width: 980px;
}

/* 亮色主题 */
.light-mode {
    --bg-primary: #f8f9fc;
    --bg-secondary: #eef1f8;
    --bg-tertiary: #e7ebf5;

    --bg-card: #ffffff;
    --bg-card-hover: #f4f6fb;

    --bg-input: #f4f6fb;
    --bg-modal: #ffffff;

    --border: #d9deeb;
    --border-hover: #c2c9dc;

    --text-logo: #5b6cff;
    --text-primary: #64748b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    --accent: #5b6cff;
    --accent-hover: #4d5ef7;

    --accent-bg: rgba(91,108,255,.08);
    --accent-glow: rgba(91,108,255,.18);

    --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.10);
}

/* 暗色主题默认body */
body.dark-mode {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.light-mode {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ========== 基础样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}


body {
    font-family: -apple-system, BlinkMacSystemFont,"Microsoft YaHei", "微软雅黑","Microsoft JhengHei", "微軟正黑體","Segoe UI", Roboto,"Helvetica Neue", Arial,sans-serif, "Noto Color Emoji";
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    color: var(--text-logo);
    font-weight: 700;
    font-size: 1.55rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    font-size:1.375rem;
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 12px var(--accent-glow); }
    50% { opacity: 0.8; text-shadow: 0 0 24px var(--accent-glow), 0 0 48px var(--accent-bg); }
}

.logo-text { letter-spacing: 3px; }

.menu-toggle { display: none; }


.nav-links {
    display: flex;
    gap: 3px;
    align-items: center;
}

.nav-links a {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover { color: var(--text-primary); background: var(--accent-bg); }
.nav-links a.active { color: var(--accent); background: var(--accent-bg); }

.nav-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

       .btn-search, .lang-select, .btn-post {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border);
            color: var(--text-primary);
            padding: 6px 10px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
        }
        .btn-post { background: var(--accent); border: none; font-weight: 500; }

/* 语言选择器 */
.lang-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .9rem;
    padding: 4px 6px;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}
.lang-select:focus { border-color: var(--accent); }

/* 主题切换 */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 1rem;
}
.theme-toggle:hover { background: var(--accent-bg); }


.moon-icon, .sun-icon {
    display: inline-block;
    position: relative;
    font-size: 0 !important;
    line-height: 0;
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: text-bottom;
}

.moon-icon::before, .sun-icon::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.moon-icon::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path fill-rule='evenodd' d='M9.528 1.718a.75.75 0 01.162.819A8.97 8.97 0 009 6a9 9 0 009 9 8.97 8.97 0 003.463-.69.75.75 0 01.981.98 10.503 10.503 0 01-9.694 6.46c-5.799 0-10.5-4.701-10.5-10.5 0-4.368 2.667-8.112 6.46-9.694a.75.75 0 01.818.162z' clip-rule='evenodd' /></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path fill-rule='evenodd' d='M9.528 1.718a.75.75 0 01.162.819A8.97 8.97 0 009 6a9 9 0 009 9 8.97 8.97 0 003.463-.69.75.75 0 01.981.98 10.503 10.503 0 01-9.694 6.46c-5.799 0-10.5-4.701-10.5-10.5 0-4.368 2.667-8.112 6.46-9.694a.75.75 0 01.818.162z' clip-rule='evenodd' /></svg>");
}

.sun-icon::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1.06l1.59 1.591zM12 18a.75.75 0 01.75.75V21a.75.75 0 01-1.5 0v-2.25A.75.75 0 0112 18zM7.758 17.303a.75.75 0 00-1.061-1.06l-1.591 1.59a.75.75 0 001.06 1.061l1.591-1.59zM6 12a.75.75 0 01-.75.75H3a.75.75 0 010-1.5h2.25A.75.75 0 016 12zM6.697 7.757a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 00-1.061 1.06l1.59 1.591z' /></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1.06l1.59 1.591zM12 18a.75.75 0 01.75.75V21a.75.75 0 01-1.5 0v-2.25A.75.75 0 0112 18zM7.758 17.303a.75.75 0 00-1.061-1.06l-1.591 1.59a.75.75 0 001.06 1.061l1.591-1.59zM6 12a.75.75 0 01-.75.75H3a.75.75 0 010-1.5h2.25A.75.75 0 016 12zM6.697 7.757a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 00-1.061 1.06l1.59 1.591z' /></svg>");
}

.btn-search {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}
.btn-search:hover { color: var(--text-primary); background: var(--accent-bg); }

.btn-post {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-post:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); }

/* ========== 搜索栏 ========== */
.search-bar {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    z-index: 999;
}
.search-bar.active { display: block; }

.search-bar form {
    max-width: calc(var(--max-width) - 30px);
    margin: 0 auto;
    display: flex;
    gap: 8px;
}

.search-bar input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: .9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--accent); }

.search-bar button {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ========== 主内容区 ========== */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 16px) 16px 20px;
}

/* ========== 标签云 ========== */
.section-tags { margin-bottom: 22px; }

.section-title {
    font-size:1.375rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.tags-cloud , .more-tags-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-item {
    display: inline-block;
    padding: 5px 14px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tag-item:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* ========== 节点卡片 ========== */
.section-nodes { margin-bottom: 36px; }

.node-feed { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px;}

.node-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.node-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.node-card-image {
    margin-bottom: 12px;
    overflow: hidden;
    max-height: 200px;
}

.node-card-image img {
    height: 200px;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.node-title {
    font-size:1.375rem;
    font-weight: 600;
    color: var(--text-logo);
    margin-bottom: 8px;
    line-height: 1.4;
}

.node-excerpt {
    font-size:1.375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.node-card .node-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.node-card .node-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;

}

.node-card .author-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size:1rem;
    color: var(--text-tertiary);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-item.time { font-size: 1rem;color: var(--text-tertiary);margin-left: auto; }

.btn-comment {
    cursor: pointer;
    transition: color 0.2s;
}
.btn-comment:hover { color: var(--accent); }

.btn-like-static {
    cursor: default;
}

/* ========== 节点详情页 ========== */
/* .page-node .main-content { padding-top: calc(var(--nav-height) + 8px); }*/

.node-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.reply-card-link:hover .reply-card {
    border-color: var(--border-hover);
    border-left-color: var(--accent);
    background: var(--bg-card-hover);
}


/* ========== 重复回复标记（虫洞效果） ========== */
.live-repeat {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 1.1em;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    z-index: 1;
}
.live-repeat:hover {
    opacity: 1;
}

/* ========== 重复内容页 ========== */
.repeat-header {
    text-align: center;
    padding: 0 0 16px;
}

.repeat-content-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-all;
}

.repeat-header .repeat-stats {
    font-size: 1rem;
    display: block;
    margin-bottom: 16px;
}

.repeat-header .tag-sort-tabs {
    justify-content: right;
}


.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 16px) 16px;
    font-size: .9rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bc-sep { color: var(--text-tertiary); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.bc-current { color: var(--text-primary); font-weight: 500; }

.node-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.node-detail .node-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.node-detail .node-tags .tag-item { font-size: .9rem; padding: 3px 10px; }
.node-detail .node-title { font-size:1.375rem; font-weight: 700; margin-bottom: 12px; line-height: 1.35;display: flex;align-items: center;justify-content: center; }

.node-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.author-avatar-img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.reply-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-name { font-size: 1rem; font-weight: 600; color: var(--accent); display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;}
.author-time { font-size: 1rem; color: var(--text-tertiary); margin-left: auto; }

.node-content {
    font-size:1.375rem;
    line-height: 1.8;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 18px;
}

.node-content p {
    margin: 0 0 1em 0;
}

.node-content p:last-child {
    margin-bottom: 0;
}
.node-image {
    margin-bottom: 18px;
    overflow: hidden;
}

.node-image img {
    max-width: 100%;
    display: block;
    cursor: pointer;
}

/* ========== 图片九宫格 ========== */
.image-grid {
    margin-bottom: 18px;
    display: grid;
    gap: 4px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.image-grid-2 { grid-template-columns: 1fr 1fr; }
.image-grid-2 img { height: 200px; }

.image-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.image-grid-3 img { height: 160px; }

.image-grid-4 { grid-template-columns: 1fr 1fr; }
.image-grid-4 img { height: 160px; }

.image-grid-9 { grid-template-columns: 1fr 1fr 1fr; }
.image-grid-9 img { height: 120px; }

/* ========== 节点统计 ========== */
.node-stats {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.stat-item:hover { background: var(--accent-bg); color: var(--accent); }
.btn-like:hover, .btn-like.liked { color: var(--danger); }
.btn-like.liked svg { fill: var(--danger); }

.stat-comment { cursor: pointer; }
.stat-comment:hover { color: var(--accent); }

/* ========== 导航按钮栏 ========== */
.node-nav-bar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-nav:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.btn-nav-back { background: var(--accent-hover);color: #fff;box-shadow: var(--shadow-glow);}

.btn-nav-reply {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-nav-reply:hover { background: var(--accent-hover); color: #fff; box-shadow: var(--shadow-glow); }

/* ========== 回复列表 ========== */
.section-replies { margin-bottom: 10px; }

.reply-list { display: flex; flex-direction: column; gap: 8px; }

.reply-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    transition: all 0.2s;
    border-left: 3px solid var(--accent-bg);
    cursor: pointer;
    margin-bottom: 8px;
}

.reply-card:hover { border-color: var(--border-hover); border-left-color: var(--accent); background: var(--bg-card-hover); }

.reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 1rem;
}

.reply-author { color: var(--accent); font-weight: 600; display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;}
.reply-time { color: var(--text-tertiary); margin-left: auto; }

.reply-content {
    font-size: 1.375rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-word;
}

.reply-content p {
    margin: 0 0 0.8em 0;
}

.reply-content p:last-child {
    margin-bottom: 0;
}

.reply-image {
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.reply-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.reply-meta {
    font-size: 1rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 12px;
}

/* ========== 同级节点 ========== */
.section-siblings { margin-bottom: 10px; }

.sibling-list { display: flex; flex-wrap: wrap; gap: 8px; }

.sibling-item {
    display: inline-block;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sibling-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.sibling-item.current { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); font-weight: 600; }

/* ========== 相关推荐 ========== */
.section-related { margin-bottom: 32px; }

.related-list { display: flex; flex-direction: column; gap: 6px; }

.related-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-decoration: none;
    gap: 12px;
}

.related-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }

.related-title { font-size: 1.25rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.related-meta { font-size: 1rem; color: var(--text-tertiary); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* ========== 标签页 ========== */
.tag-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.tag-page-title { font-size: 1.5rem; }

.tag-sort-tabs { display: flex; gap: 4px;}

.sort-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
    text-decoration: none;
}

.sort-tab:hover { border-color: var(--accent); color: var(--accent); }
.sort-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ========== 搜索页 ========== */
.search-section { margin-bottom: 24px; }
.search-form { display: flex; gap: 8px; }

.search-form input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.search-form input:focus { border-color: var(--accent); }

.search-form button {
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.result-count { font-size: .9rem; font-weight: 400; color: var(--text-tertiary); }

/* ========== 页面标题 ========== */
.page-title { font-size:1.375rem; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.3px; }
.page-desc { font-size: 1rem; color: var(--text-secondary); margin-bottom: 20px; }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-tertiary); font-size: 1rem; }

/* ========== 错误页 ========== */
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 72px; font-weight: 700; color: var(--accent); margin-bottom: 12px; text-shadow: 0 0 40px var(--accent-glow); }
.error-page p { font-size: 16px; color: var(--text-secondary); margin-bottom: 24px; }

.btn-back {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
}
.btn-back:hover, 
.btn-back:active, 
.btn-back:focus {
    color: #fff;
}
/* ========== 导航提示（PC端边缘） ========== */
.nav-hint {
    position: fixed;
    color: var(--text-tertiary);
    font-size: .9rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 900;
    pointer-events: none;
    white-space: nowrap;
}

.nav-hint:hover { opacity: 1; pointer-events: auto; }
.nav-hint-left { left: 8px; top: 50%; transform: translateY(-50%); }
.nav-hint-right { right: 8px; top: 50%; transform: translateY(-50%); }
.nav-hint-down { bottom: 8px; left: 50%; transform: translateX(-50%); }
.nav-hint-up { top: calc(var(--nav-height) + 8px); left: 50%; transform: translateX(-50%); }

@media (hover: hover) and (pointer: fine) {
    .nav-hint { opacity: 0.3; }
    .nav-hint:hover { opacity: 1; }
}

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    backdrop-filter: blur(8px);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s;
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); overflow-y: auto;scrollbar-width: thin;
    scrollbar-color: #bbb transparent;}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.modal-header h2 { font-size: 1.375rem; font-weight: 700; }

.modal-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--border); border-radius: 50%;
    color: var(--text-primary); font-size: 1.25rem; cursor: pointer; transition: all 0.2s;
}
.modal-close:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* ========== 表单 ========== */
.form-group { margin-bottom: 15px; }
.form-group label {font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 1px; }
.required { color: var(--danger); }

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    overflow: hidden;
}

.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-tertiary); }

.image-preview { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); margin-top: 8px; }


/* ========== 图片上传区域 ========== */
.image-upload-area { margin-top: 4px; position: relative; }

.image-upload-buttons {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.image-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1;
}
.image-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(var(--accent-rgb, 59,130,246), 0.06);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb, 59,130,246), 0.12);
    transform: translateY(-1px);
}
.image-upload-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.image-upload-btn-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.image-upload-btn-text {
    white-space: nowrap;
}

/* 拍照按钮 - PC端隐藏，移动端显示 */
.image-upload-btn-camera {
    display: none;
}

.image-upload-hint {
    margin-top: 6px;
    font-size: .9rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.image-preview-container {
    position: relative;
    display: inline-block;
    margin-top: 8px;
    max-width: 100%;
}

.image-preview-container .image-preview {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.image-remove-btn:hover { background: rgba(220,38,38,0.85); }


.tag-input-area { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--bg-input); }
.tag-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-suggestion {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px;
    background: var(--accent-bg); color: var(--accent);
    border-radius: 16px; font-size: .9rem; cursor: pointer;
    transition: all 0.2s; user-select: none;
}
.tag-suggestion:hover { background: var(--accent); color: #fff; }
.tag-suggestion.selected { background: var(--accent); color: #fff; }
.tag-suggestion.selected::after { content: ' ×'; font-size: .9rem; font-weight: bold; }

#customTagInput {
    width: 100%; background: none; 
    color: var(--text-primary); font-size: .9rem;
    outline: none; font-family: inherit; padding: 6px 0 6px 0;
    margin-top: 10px; 
}

.optional { font-size: .9rem; color: var(--text-tertiary); font-weight: normal; }

.btn-like-reply {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 0; font-size: 1rem;
    display: inline-flex; align-items: center; gap: 3px;
    transition: color 0.2s;
}
.btn-like-reply:hover { color: var(--accent); }
.btn-like-reply.liked { color: #e5484d; }

/* 主题插入回复 可删除 */
.reply-badge {
    display: inline-block; font-size: .9rem; padding: 1px 8px;
    background: rgba(123, 104, 238, 0.15); color: var(--accent);
    border-radius: 10px; margin-bottom: 4px;
}

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

.btn-cancel {
    padding: 10px 20px; background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-secondary);
    font-size: .9rem; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-cancel:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-submit {
    padding: 10px 24px; background: var(--accent); border: none;
    border-radius: var(--radius-sm); color: #fff; font-size: .9rem;
    font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-submit:hover { background: var(--accent-hover); }

/* 身份输入行 */
.form-identity-row .identity-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.form-identity-row input.text {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 12px;
    color: var(--text-primary); font-size: 0.9rem;
    font-family: inherit; outline: none; transition: border-color 0.2s; min-width: 0;
}
.form-identity-row input.text:focus { border-color: var(--accent); }
.form-identity-row input#inpName { width: 220px; }
.form-identity-row input#inpEmail { width: 220px; }

.identity-sub-label { font-size: .9rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

/* ========== 昵稱輸入框 ========== */
.name-input-wrap { position: relative; display: inline-block; }
.name-input-wrap input#inpName { padding-right: 32px; }
.btn-random-name {
    position: absolute; right: 4px; top: 50%;
    transform: translateY(-50%);
    background: transparent; border: none; cursor: pointer;
    font-size: 16px; line-height: 1; padding: 2px 4px;
    color: var(--text-secondary); opacity: 0.6;
    transition: opacity 0.15s, transform 0.15s;
    -webkit-user-select: none; user-select: none;
}
.btn-random-name:hover { opacity: 1; transform: translateY(-50%) rotate(15deg); }
.btn-random-name:active { transform: translateY(-50%) rotate(180deg); }
@media (max-width: 768px) {
    .name-input-wrap { display: block; }
    .name-input-wrap input#inpName { width: 100%; }
}

/* ========== 灯箱 ========== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    cursor: pointer;
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }

.lightbox-img {
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    right: 16px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
    max-width: 320px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ========== 滑动动画 ========== */
.slide-page { position: absolute; width: 100%; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s; }
.slide-page.slide-left { transform: translateX(-100%); opacity: 0; }
.slide-page.slide-right { transform: translateX(100%); opacity: 0; }
.slide-page.slide-up { transform: translateY(-100%); opacity: 0; }
.slide-page.slide-down { transform: translateY(100%); opacity: 0; }
.slide-page.slide-center { transform: translate(0,0); opacity: 1; }

/* ========== 响应式 ========== */
@media (max-width: 850px) {
     .logo .logo-icon {display: none;}
            .menu-toggle {
                display: flex;
                background: none;
                border: none;
                padding: 4px;
                cursor: pointer;
                order: 1;
                margin-right: -4px; 
                -webkit-tap-highlight-color: transparent;
            }
            .logo { order: 2; margin-right: auto; font-size: 1.25rem; }
            .nav-actions { order: 3; }
            .hamburger {
                position: relative;
                display: block;
                width: 18px;
                height: 2px;
                background: var(--text-secondary);
                transition: transform 0.2s, background 0.2s;
            }
            .hamburger::before, .hamburger::after {
                content: '';
                position: absolute;
                left: 0;
                width: 100%;
                height: 2px;
                background: var(--text-secondary);
                transition: transform 0.2s;
            }
            .hamburger::before { top: -6px; }
            .hamburger::after { bottom: -6px; }
            .menu-toggle.is-active .hamburger { background: transparent; }
            .menu-toggle.is-active .hamburger::before { transform: translateY(6px) rotate(45deg); background: var(--accent); }
            .menu-toggle.is-active .hamburger::after { transform: translateY(-6px) rotate(-45deg); background: var(--accent); }
            .nav-links {position: absolute; top: calc(var(--nav-height) - 1px); left: 2px;width: max-content;min-width: 160px; background: var(--bg-card);  border-radius: 8px;box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);display: flex;flex-direction: column;padding: 6px;gap: 2px;opacity: 0;visibility: hidden;transform: translateY(-8px) scale(0.96);transform-origin: top left;transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;z-index: 1000;}
            .nav-links.is-active {
                opacity: 1;
                visibility: visible;
                transform: translateY(0) scale(1);
            }
            .nav-links a {
                display: block;
                padding: 10px 16px;
                width: 100%;
                font-size: 0.95rem;
                text-align: left;
                border-radius: var(--radius-sm);
                -webkit-tap-highlight-color: transparent;
            }
            .nav-links a.active {
                background: var(--accent-bg);
                color: var(--accent);
            }
}
/* ========== 响应式 ========== */
@media (max-width: 640px) {
    .btn-post span { display: none; }
    .btn-post { padding: 8px 10px; }
    .navbar-inner { padding: 0 12px; }
    .node-detail { padding: 18px; border-radius: var(--radius-md); }
    .main-content { padding: calc(var(--nav-height) + 16px) 2px 20px;}
    .node-card { padding: 14px 16px; }
    .node-title { font-size: 1rem; }
    .nav-hint { display: none; }
    .modal { padding: 20px; height: 90vh; }
    .node-nav-bar { gap: 6px; }
    .btn-nav { padding: 6px 12px; font-size: .9rem; }
    .form-identity-row .identity-inputs { flex-direction: column; align-items: stretch; }
    .form-identity-row input#inpName { width: 100%; }
    .form-identity-row input#inpEmail { width: 100%; }
    .image-grid-2 img, .image-grid-3 img, .image-grid-4 img { height: 120px; }
    .image-grid-9 img { height: 90px; }
    .node-stats {gap: 1px;}
    .image-upload-btn-camera { display: inline-flex; }
    .tags-cloud, .more-tags-grid, .page-title, .page-desc{padding: 0 5px;}
    .tag-header, .section-title{padding: 0 5px;}
    .repeat-header .tag-sort-tabs {justify-content: center;}
    .author-name {max-width: 200px;}
}
@media (min-width: 641px) and (max-width: 1024px) {
    .nav-links a { padding: 6px 8px; font-size: .9rem; }
    .logo {font-size: 1.25rem;gap: 4px;}
    .modal { padding: 20px; height: 90vh; }
}

/* ========== 暗色模式星空 ========== */
.dark-mode body::before,
body.dark-mode::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(123,104,238,0.3), transparent),
        radial-gradient(1px 1px at 30% 70%, rgba(123,104,238,0.2), transparent),
        radial-gradient(1px 1px at 50% 10%, rgba(123,104,238,0.15), transparent),
        radial-gradient(1px 1px at 70% 50%, rgba(123,104,238,0.2), transparent),
        radial-gradient(1px 1px at 90% 80%, rgba(123,104,238,0.3), transparent),
        radial-gradient(1px 1px at 20% 90%, rgba(123,104,238,0.15), transparent),
        radial-gradient(1px 1px at 80% 30%, rgba(123,104,238,0.2), transparent);
    pointer-events: none;
    z-index: -1;
}

.light-mode::before { display: none; }

.footer {
    width: 100%;
    height: 40px;
    margin: 20px 0;
    -webkit-font-smoothing: antialiased;
    font-size: 1rem;
    font-weight: 400;
    color: var(--icon-color);
    line-height: 40px;
    text-align: center;
    position: relative;
}

.footer a, .footer a:active, .footer a:focus {
    text-decoration: none;
    color: var(--icon-color);
}

.footer a:hover {
    color: var(--text-color);
}

    #backToTop {
      position: fixed;
      bottom: 100px;
      right: 30px;
      width:2.75rem;
      height: 2.75rem;
      line-height: 2.75rem;
      background-color: var(--accent);
      color: #fff;
      border: none;
      border-radius: 50%;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      overflow: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
     -webkit-transform: opacity 0.3s ease, visibility 0.3s ease;
      transform: rotate(0deg);
      -webkit-transform: rotate(0deg);
      z-index: 9999;
    }
    #backToTop.show {
      opacity: 1;
      visibility: visible;
    }
    #backToTop:hover {
      background-color: var(--accent-hover);
    }
/* ========== 打印 ========== */
@media print {
    .navbar, .nav-hint, .search-bar, .modal-overlay, .node-nav-bar, .lang-select, .theme-toggle { display: none !important; }
    body { background: #fff; color: #000; }
    .node-card, .node-detail { border: 1px solid #ccc; box-shadow: none; }
}


/* ========== 图文直播标识 ========== */
.live-badge {
display: inline-block;
    padding: 5px 7px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, #e5484d, #f02945);
    border-radius: 5px;
    vertical-align: middle;
    margin-right: 5px;
    animation: live-pulse 3s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.live-notice {
    padding: 10px 16px;
    margin-bottom: 12px;
    background: rgba(229, 72, 77, 0.08);
    border: 1px solid rgba(229, 72, 77, 0.2);
    border-radius: var(--radius-md, 10px);
    color: var(--text-secondary, #8889aa);
    font-size: 0.9em;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn-live-post {
    white-space: nowrap;
    margin-left: auto;
}

/* ========== 回复卡片插入动画 ========== */
.reply-card-new {
    opacity: 0;
    transform: translateY(12px);
}
.reply-card-animate {
    animation: replySlideIn 0.4s ease-out forwards;
}
@keyframes replySlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.light-mode .live-notice {
    background: rgba(229, 72, 77, 0.05);
    border-color: rgba(229, 72, 77, 0.15);
}

.light-mode .live-notice {
    background: rgba(229, 72, 77, 0.05);
    border-color: rgba(229, 72, 77, 0.15);
}


    .wormhole {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      position: relative;
      overflow: hidden;
      background: radial-gradient(
        circle at center, 
        #ffffff 0%, 
        #00ffff 15%,
        #8a2be2 45%,
        #000000 75%
      );
      box-shadow: 0 0 8px 2px rgba(138, 43, 226, 0.3);
    }
    .wormhole::before {
      content: '';
      position: absolute;
      top: 50%; left: 50%;
      width: 200%; height: 200%;
      margin-top: -100%; margin-left: -100%;
      background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(138, 43, 226, 0.9) 10%, 
        transparent 20%,
        rgba(0, 191, 255, 0.9) 30%, 
        transparent 40%,
        rgba(255, 0, 128, 0.7) 50%,
        transparent 60%,
        rgba(138, 43, 226, 0.9) 70%,
        transparent 80%,
        rgba(0, 191, 255, 0.9) 90%,
        transparent 100%
      );
      -webkit-mask: radial-gradient(circle, transparent 25%, black 40%, black 55%, transparent 75%);
      mask: radial-gradient(circle, transparent 25%, black 40%, black 55%, transparent 75%);
      animation: flow-in 3.6s linear infinite;
    }
    .wormhole::after {
      content: '';
      position: absolute;
      top: 50%; left: 50%;
      width: 200%; height: 200%;
      margin-top: -100%; margin-left: -100%;
      background: conic-gradient(
        from 180deg,
        transparent 0%,
        rgba(0, 255, 255, 0.8) 15%,
        transparent 30%,
        rgba(255, 0, 255, 0.8) 45%,
        transparent 60%,
        rgba(0, 255, 255, 0.8) 75%,
        transparent 100%
      );
      -webkit-mask: radial-gradient(circle, transparent 25%, black 40%, black 55%, transparent 75%);
      mask: radial-gradient(circle, transparent 25%, black 40%, black 55%, transparent 75%);
    }
    @keyframes flow-in {
      0% {
        transform: scale(1.6) rotate(0deg);
        opacity: 0;
      }
      20% {
        opacity: 1;
      }
      100% {
        transform: scale(0.1) rotate(90deg);
        opacity: 0;
      }
    }


/* ============================================================
   用户主页与用户排行榜样式（新增功能）
   ============================================================ */

/* 用户主页头部 */
.user-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.user-info-block {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.user-avatar-large-link {
    flex-shrink: 0;
    display: inline-block;
}

.user-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary, #e5e7eb);
    object-fit: cover;
    background: var(--bg-tertiary, #f3f4f6);
}

.user-meta-block {
    flex: 1;
    min-width: 200px;
}

.user-stats {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
}

.user-stats .stat-item strong {
    color: var(--text-primary, #111827);
    margin-left: 4px;
}

/* 用户排行榜网格 */
.user-rank-section {
    margin-bottom: 32px;
}

.user-rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.user-rank-item {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
}

.user-rank-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-rank-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 节点作者超链接 */
.author-link,
.reply-author-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.author-link:hover,
.reply-author-link:hover {
    color: var(--accent-color, #3b82f6);
}

.author-link .author-name,
.reply-author-link .reply-author {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s;
}

.author-link:hover .author-name,
.reply-author-link:hover .reply-author {
    text-decoration-color: currentColor;
}

/* 用户主页 not-found 页面 */
.page-user-notfound .error-page {
    text-align: center;
    padding: 60px 20px;
}

.page-user-notfound .error-page h1 {
    font-size: 72px;
    color: var(--text-tertiary, #9ca3af);
    margin-bottom: 16px;
}
#replies-anchor {
    scroll-margin-top: calc(var(--nav-height) + 15px); 
}
/* 响应式：移动端用户主页头部紧凑布局 */
@media (max-width: 640px) {
    .user-info-block {
        gap: 12px;
        padding: 0 5px;
    }
    .user-avatar-large {
        width: 64px;
        height: 64px;
    }
    .user-stats {
        gap: 12px;
        font-size: 13px;
    }
    .user-rank-grid {
        max-width: 100%;
    }
}
