/* ============================================================
   MyBlog · 设计系统 v2
   卡片式布局 · 毛玻璃效果 · 平滑过渡动画
   ============================================================ */

/* ----- CSS 变量 ----- */
:root {
    --bg: #f0f4f8;
    --bg-alt: #e8edf3;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --text: #1a1d28;
    --text-secondary: #5a6070;
    --text-muted: #949aab;
    --primary: #4a90e2;
    --primary-light: #e8f1fd;
    --primary-dark: #3578c2;
    --primary-border: rgba(74, 144, 226, 0.30);
    --accent: #6c5ce7;
    --accent-light: #f0edff;
    --sakura: #f2a0b6;
    --sakura-light: #fdf2f5;
    --sakura-dark: #e8879e;
    --sakura-border: rgba(242, 160, 182, 0.35);
    --sakura-glow: rgba(242, 160, 182, 0.25);
    --danger: #e74c3c;
    --danger-light: #fdecea;
    --danger-border: rgba(231, 76, 60, 0.25);
    --success: #2ecc71;
    --success-light: #e8faf0;
    --success-border: rgba(46, 204, 113, 0.25);
    --warning: #f39c12;
    --warning-light: #fef7e8;
    --border: #dce3ea;
    --border-light: #eef1f6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.14);
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    --bg-image: none;
    --panel-opacity: 1;
    /* 渐变背景动画颜色 */
    --grad-base: #e8edf6;
    --grad-blue: #dbeafe;
    --grad-pink: #fce4ec;
    --grad-mid: #f0f4fa;
}

/* 深色模式变量覆盖 */
.dark-mode {
    --bg: #0f1119;
    --bg-alt: #161922;
    --surface: #1a1d2a;
    --surface-hover: #212536;
    --text: #e4e6f0;
    --text-secondary: #a0a5b8;
    --text-muted: #606580;
    --primary: #5b9cf5;
    --primary-light: #1e2d44;
    --primary-dark: #4a8ae0;
    --primary-border: rgba(91, 156, 245, 0.30);
    --accent: #8b7cf0;
    --accent-light: #221f3a;
    --sakura: #f2a0b6;
    --sakura-light: #2a1a20;
    --sakura-dark: #d8708a;
    --sakura-border: rgba(242, 160, 182, 0.30);
    --sakura-glow: rgba(242, 160, 182, 0.18);
    --danger: #ff5e7a;
    --danger-light: #2a1a20;
    --danger-border: rgba(255, 94, 122, 0.25);
    --success: #4caf84;
    --success-light: #1a2a22;
    --success-border: rgba(76, 175, 132, 0.25);
    --warning: #ffb74d;
    --warning-light: #2a2218;
    --border: #2a2d3a;
    --border-light: #1f2230;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow: 0 4px 16px rgba(0,0,0,0.28);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.35);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.45);
    --grad-base: #11131f;
    --grad-blue: #161f33;
    --grad-pink: #24161e;
    --grad-mid: #181a28;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-override, var(--bg));
    color: var(--text);
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* ----- SVG 图标工具类 ----- */
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    display: inline-block;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

/* 渐变流动背景 — 水流效果 */
body.bg-flow {
    background: linear-gradient(
        135deg,
        var(--grad-base) 0%,
        var(--grad-pink) 15%,
        var(--grad-blue) 30%,
        var(--grad-mid) 50%,
        var(--grad-base) 65%,
        var(--grad-pink) 80%,
        var(--grad-blue) 100%
    );
    background-size: 400% 400%;
    animation: gradientFlow 20s ease infinite;
    transition: background 1s ease, color var(--transition);
}
/* 渐变背景动画关键帧 */
@keyframes gradientFlow {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 100% 0%; }
    50%  { background-position: 100% 100%; }
    75%  { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}
/* 自定义背景图片层 — 通过伪元素实现背景图片叠加 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.15;
    z-index: -2;
    pointer-events: none;
    transition: opacity var(--transition);
}
/* 渐变装饰层 — 营造氛围感的侧边发光效果 */
body::after {
    content: '';
    position: fixed;
    top: -30%; left: -20%;
    width: 80%; height: 80%;
    background: radial-gradient(ellipse, var(--primary-light) 0%, transparent 70%);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    transition: opacity var(--transition);
}

/* ============================================================
   导航栏
   ============================================================ */
.nav-bar {
    position: sticky;
    top: 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 12px auto 0;
    padding: 10px 20px;
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transition: all var(--transition);
    gap: 12px;
}
/* 导航品牌标志 */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}
.nav-brand svg { width: 24px; height: 24px; flex-shrink: 0; }
.nav-brand span { transition: color var(--transition); }
.nav-brand small {
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 2px;
}

/* 导航链接列表 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}
.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 24px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-links a:hover {
    background: var(--bg-alt);
    color: var(--primary);
}
.nav-links a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.nav-links a svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 导航右侧操作区 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 导航按钮 */
.nav-btn {
    padding: 7px 14px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.nav-btn:hover { background: var(--bg-alt); border-color: var(--primary); color: var(--primary); }
.nav-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
/* 管理后台激活状态的按钮 */
.nav-btn.admin-active {
    color: var(--success);
    border-color: var(--success);
    background: var(--success-light);
}
/* 退出登录按钮悬停样式 */
.nav-btn.logout-btn:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* 移动端导航汉堡菜单按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* ============================================================
   布局容器
   ============================================================ */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: calc(100vh - 80px);
}

/* ============================================================
   区块布局 — 干净的页面区块结构
   ============================================================ */

/* 区块容器 — 每个内容块的外包装 */
.page-section {
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    overflow: hidden;
}
.page-section + .page-section {
    margin-top: 0;
}
/* 区块内边距 */
.section-inner {
    padding: 32px 28px;
}
/* 区块标题栏 */
.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 20px 0;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
}
/* 英雄区块变体 — 渐变色背景 */
.hero-section {
    background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--primary) 6%, var(--surface)));
    border: 1px solid var(--border);
    text-align: center;
}
.hero-section .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================================
   英雄区（首页顶部展示区）
   ============================================================ */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px 36px;
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
/* 英雄区顶部装饰渐变线 */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
/* 头像容器 — 带呼吸灯效果 */
.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 18px;
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.3);
    transition: all var(--transition);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    animation: avatarGlow 2.5s ease-in-out infinite;
}
/* 头像呼吸发光环动画 */
@keyframes avatarGlow {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(74, 144, 226, 0.3), 0 0 0 0 rgba(242, 160, 182, 0.5);
    }
    50% {
        box-shadow: 0 8px 30px rgba(74, 144, 226, 0.3), 0 0 0 12px rgba(242, 160, 182, 0);
    }
}
.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
/* 头像悬停时的编辑提示 */
.hero-avatar .avatar-edit-hint {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition);
}
.hero-avatar:hover .avatar-edit-hint {
    opacity: 1;
}
/* 英雄区昵称 */
.hero-name {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text);
}
/* 英雄区标语 */
.hero-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.5;
}

/* ============================================================
   卡片网格
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ============================================================
   通用卡片
   ============================================================ */
.card {
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--primary-border);
}
/* 卡片图标 */
.card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.card-icon.blue { background: var(--primary-light); color: var(--primary); }
.card-icon.purple { background: var(--accent-light); color: var(--accent); }
.card-icon.green { background: var(--success-light); color: var(--success); }
.card-icon.orange { background: var(--warning-light); color: var(--warning); }

/* 卡片标题 */
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
/* 卡片正文 */
.card-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 文章卡片 */
.article-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.article-card .article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.article-card .article-date {
    display: flex;
    align-items: center;
    gap: 4px;
}
.article-card .article-date svg { width: 13px; height: 13px; }
/* 文章类型标签 */
.article-card .article-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}
.article-badge.text-post { background: var(--primary-light); color: var(--primary); }
.article-badge.md-post { background: var(--accent-light); color: var(--accent); }
.article-badge.html-post { background: var(--sakura-light); color: var(--sakura-dark); }
/* 文章摘要 — 最多显示 3 行 */
.article-card .article-excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card .article-images-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 文章统计数据行（点赞/评论/分享数） */
.article-stats-row {
    display: flex;
    gap: 16px;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
}
.article-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 空状态卡片 — 没有内容时显示 */
.empty-card {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    user-select: none;
    border: 2px dashed var(--border);
    background: transparent;
}
.empty-card:hover { transform: none; border-color: var(--border); }
.empty-card svg { width: 48px; height: 48px; opacity: 0.25; margin-bottom: 10px; }
.empty-card p { font-size: 0.88rem; line-height: 1.6; }

/* ============================================================
   页面头部
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.page-title svg { width: 28px; height: 28px; color: var(--primary); flex-shrink: 0; }

/* 页面搜索框 */
.page-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 6px 16px;
    transition: all var(--transition);
    min-width: 180px;
}
.page-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-border);
}
.page-search svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--text);
    width: 100%;
    font-family: var(--font);
}
.search-input::placeholder {
    color: var(--text-muted);
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 24px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(74,144,226,0.3); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.88; }
.btn-sm { padding: 5px 14px; font-size: 0.75rem; border-radius: 18px; }
.btn-sm svg { width: 13px; height: 13px; }

/* ============================================================
   文章详情（完整视图）
   ============================================================ */
.article-detail {
    transition: all var(--transition);
}
.article-detail .article-detail-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-light);
}
.article-detail .article-detail-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text);
}
.article-detail .article-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.article-detail .article-detail-body {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text);
    word-break: break-word;
}
/* 代码块样式 */
.article-detail .article-detail-body pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 14px 0;
}
.article-detail .article-detail-body code {
    font-family: var(--font-mono);
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}
/* 文章内标题样式 */
.article-detail .article-detail-body h1,
.article-detail .article-detail-body h2,
.article-detail .article-detail-body h3 {
    margin: 20px 0 10px;
    font-weight: 700;
}
.article-detail .article-detail-body h1 { font-size: 1.5rem; }
.article-detail .article-detail-body h2 { font-size: 1.25rem; }
.article-detail .article-detail-body h3 { font-size: 1.1rem; }
.article-detail .article-detail-body ul,
.article-detail .article-detail-body ol { margin: 10px 0; padding-left: 24px; }
.article-detail .article-detail-body li { margin: 4px 0; }
/* 引用块样式 */
.article-detail .article-detail-body blockquote {
    border-left: 3px solid var(--primary);
    padding: 8px 16px;
    margin: 14px 0;
    background: var(--bg-alt);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    color: var(--text-secondary);
}
/* 文章内图片 */
.article-detail .article-detail-body img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    box-shadow: var(--shadow-sm);
}
/* 文章内表格 */
.article-detail .article-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}
.article-detail .article-detail-body th,
.article-detail .article-detail-body td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.article-detail .article-detail-body th {
    background: var(--bg-alt);
    font-weight: 600;
}
/* 文章图片网格展示 */
.article-detail .article-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}
.article-detail .article-detail-images img {
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--transition);
}
.article-detail .article-detail-images img:hover {
    transform: scale(1.03);
}

/* 返回按钮 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 0;
    margin-bottom: 8px;
    transition: opacity var(--transition);
}
.back-link:hover { opacity: 0.7; }
.back-link svg { width: 18px; height: 18px; }

/* ============================================================
   管理后台栏（页面内操作栏）
   ============================================================ */
.admin-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    transition: all var(--transition);
}
.admin-bar.active { display: flex; opacity: var(--panel-opacity); }
.admin-bar .admin-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-bar .admin-label svg { width: 16px; height: 16px; }

/* ============================================================
   模态框
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }

/* 模态框主体 */
.modal-box {
    background: var(--surface);
    opacity: var(--panel-opacity);
    border-radius: var(--radius);
    padding: 26px 28px 30px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    transition: all var(--transition);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.25s ease-out;
}
/* 模态框入场动画 */
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-box.wide { max-width: 720px; }

/* 模态框头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.08rem; font-weight: 700; }
.modal-header .close-modal {
    background: none; border: none;
    font-size: 1.6rem; cursor: pointer;
    color: var(--text); opacity: 0.35;
    transition: opacity var(--transition);
    line-height: 1;
}
.modal-header .close-modal:hover { opacity: 0.75; }

/* ============================================================
   表单
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.88rem;
    font-family: var(--font);
    transition: all var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}
/* 只读输入框 */
.form-group input[readonly] {
    background: var(--bg-alt);
    color: var(--text-muted);
    cursor: default;
}
.form-group textarea { resize: vertical; min-height: 120px; font-family: var(--font); }
.form-group textarea.mono { font-family: var(--font-mono); font-size: 0.82rem; }
/* 表单提示文字 */
.form-group .form-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}
/* 文件上传输入框 */
.form-group input[type="file"] {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.form-group input[type="file"]::file-selector-button {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.8rem;
    margin-right: 10px;
    transition: all var(--transition);
}
.form-group input[type="file"]::file-selector-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 类型选择器（单选按钮样式） */
.type-selector {
    display: flex;
    gap: 8px;
}
.type-option {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    user-select: none;
}
.type-option:hover { border-color: var(--primary); color: var(--primary); }
.type-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* 背景类型选择器（渐变/纯色/图片） */
.bg-type-selector {
    display: flex;
    gap: 8px;
}
.bg-type-option {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
    user-select: none;
}
.bg-type-option:hover { border-color: var(--primary); }
.bg-type-option input { display: none; }
/* 选中状态的背景类型选项 */
.bg-type-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.bg-type-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    pointer-events: none;
}
.bg-type-option:has(input:checked) .bg-type-label {
    color: var(--primary);
}
.bg-type-option:hover .bg-type-label {
    color: var(--primary);
}

/* 图片上传区域 */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
}
.image-upload-area:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
/* Markdown 媒体上传区域 */
.md-media-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    margin-top: 6px;
}
.md-media-upload-area:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}
/* Markdown 媒体项目列表 */
.md-media-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.md-media-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.md-media-item .md-media-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-media-item .md-media-type {
    font-size: 0.75rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-alt);
    color: var(--text-muted);
}
/* 图片预览区域 */
.image-previews {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.image-preview-item {
    position: relative;
    width: 80px; height: 80px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    border: 1px solid var(--border);
}
.image-preview-item img {
    width: 100%; height: 100%;
    object-fit: cover;
}
/* 图片删除按钮 */
.image-preview-item .remove-img {
    position: absolute;
    top: 2px; right: 2px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 模态框操作按钮区 */
.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* 模态框消息提示 */
.modal-msg {
    font-size: 0.78rem;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    margin-bottom: 14px;
    display: none;
    line-height: 1.4;
}
.modal-msg.error {
    display: block;
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}
.modal-msg.success {
    display: block;
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

/* ============================================================
   Toast 提示
   ============================================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    color: var(--text);
    padding: 11px 28px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2000;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================================
   页脚
   ============================================================ */
.app-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    user-select: none;
}

/* ============================================================
   图片灯箱
   ============================================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
}

/* ============================================================
   工作室卡片（HeSource Studio 区块）
   ============================================================ */
.studio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--sakura-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
/* 顶部装饰渐变线 */
.studio-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sakura), var(--primary), var(--accent));
}
.studio-card .studio-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px var(--sakura-glow);
    background: var(--sakura-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    transition: all var(--transition);
}
.studio-card .studio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.studio-card .studio-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}
.studio-card .studio-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 500px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================================
   樱花飘落动画 — 纯 CSS 花瓣
   ============================================================ */
.sakura-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}
.sakura-petal {
    position: absolute;
    top: -40px;
    pointer-events: none;
    user-select: none;
    /* 花瓣形状：非对称圆角 + 旋转形成樱花花瓣轮廓 */
    width: 14px;
    height: 10px;
    border-radius: 0 100% 0 100%;
    background: var(--petal-color, #f2a0b6);
    opacity: 0.85;
    animation: sakuraFall linear forwards;
    box-shadow: 0 0 4px var(--petal-glow, rgba(242,160,182,0.3));
}
/* 花瓣飘落动画关键帧 — 带横向飘移 */
@keyframes sakuraFall {
    0%   {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 0;
    }
    8%   { opacity: 0.9; }
    18%  { transform: translateY(18vh) rotate(70deg) translateX(50px); opacity: 0.85; }
    38%  { transform: translateY(38vh) rotate(160deg) translateX(-40px); }
    58%  { transform: translateY(58vh) rotate(250deg) translateX(60px); opacity: 0.7; }
    78%  { transform: translateY(78vh) rotate(330deg) translateX(-50px); }
    92%  { opacity: 0.3; }
    100% { transform: translateY(105vh) rotate(420deg) translateX(30px); opacity: 0; }
}

/* 回到底部按钮 */
.go-bottom-btn {
    position: fixed;
    bottom: 130px;
    right: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 2000;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    user-select: none;
    color: var(--text-muted);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.go-bottom-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.go-bottom-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================================
   HTML 文章渲染
   ============================================================ */
.article-detail-body.html-content {
    /* 重置可能干扰嵌入式 HTML 的全局样式 */
    all: initial;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.8;
    word-break: break-word;
}
.article-detail-body.html-content * {
    max-width: 100%;
}
.article-detail-body.html-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

/* ============================================================
   设置区块标题（统一站点设置模态框）
   ============================================================ */
.settings-section {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    letter-spacing: 0.3px;
}
.settings-section:first-of-type {
    margin-top: 4px;
}

/* ============================================================
   响应式布局
   ============================================================ */
@media (max-width: 820px) {
    .card-grid { grid-template-columns: 1fr; }
    .card-grid.cols-2, .card-grid.cols-3 { grid-template-columns: 1fr; }
    .article-detail { padding: 20px 18px; }
    .article-detail .article-detail-title { font-size: 1.3rem; }
    .nav-links { display: none; }
    /* 展开的移动端导航 */
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 8px);
        left: 0; right: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 8px;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.open a { padding: 10px 16px; border-radius: var(--radius-sm); }
    .nav-toggle { display: block; }
}

@media (max-width: 480px) {
    .app-container { padding: 12px 10px 30px; gap: 14px; }
    .section-inner { padding: 24px 16px; }
    .hero-avatar { width: 72px; height: 72px; font-size: 1.8rem; }
    .hero-name { font-size: 1.3rem; }
    .page-title { font-size: 1.15rem; }
    .modal-box { padding: 18px 16px 22px; }
    .nav-bar { padding: 8px 10px; margin: 6px 4px 0; border-radius: var(--radius); }
    .type-selector { flex-direction: column; }
    .go-bottom-btn { bottom: 110px; right: 16px; width: 40px; height: 40px; font-size: 1.1rem; }
    .studio-card { padding: 24px 16px; }
    .studio-card .studio-image { width: 60px; height: 60px; font-size: 1.6rem; }
    /* 移动端导航操作 — 防止溢出 */
    .nav-actions { gap: 4px; }
    .nav-actions .nav-btn { padding: 5px 8px; font-size: 0.7rem; border-radius: 18px; }
    .nav-actions .nav-btn svg { width: 13px; height: 13px; }
    /* 修复 iOS 渐变背景溢出 */
    body::before, body::after {
        position: fixed;
        background-attachment: scroll;
    }
    body.bg-flow {
        background-attachment: fixed;
        background-size: 300% 300%;
    }
    /* 管理后台栏紧凑模式 */
    .admin-bar { padding: 6px 10px; gap: 4px; }
    .admin-bar .btn-sm { padding: 3px 8px; font-size: 0.65rem; }
    .admin-bar .admin-label { font-size: 0.7rem; }
    /* 文章统计紧凑模式 */
    .article-stats-row { gap: 10px; font-size: 0.7rem; }
}

/* ============================================================
   用户系统
   ============================================================ */

/* 用户认证模态框标签切换 */
.user-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--border);
}
.user-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    user-select: none;
}
.user-tab:hover { color: var(--primary); }
.user-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.user-tab-content { display: none; }
.user-tab-content.active { display: block; }

/* 验证码 */
.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}
.captcha-group input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.88rem;
    font-family: var(--font);
    transition: all var(--transition);
}
.captcha-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,226,0.12);
}
.captcha-question {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    user-select: none;
    min-width: 80px;
    text-align: center;
}
.captcha-refresh {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color var(--transition);
    padding: 4px;
}
.captcha-refresh:hover { color: var(--primary); }

/* 导航栏中的用户徽章 */
.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 4px;
    border-radius: 24px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}
.user-badge:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.user-badge .user-avatar-mini {
    width: 26px; height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--primary);
    overflow: hidden;
    flex-shrink: 0;
}
.user-badge .user-avatar-mini img {
    width: 100%; height: 100%;
    object-fit: cover;
}
/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
    display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
}
.user-dropdown-item:hover { background: var(--bg-alt); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* 用户设置模态框 */
.user-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.user-info-row .user-info-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
    overflow: hidden;
    flex-shrink: 0;
}
.user-info-row .user-info-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info-row .user-info-meta { flex: 1; }
.user-info-row .user-info-meta .info-name { font-weight: 700; font-size: 0.95rem; }
.user-info-row .user-info-meta .info-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.user-info-row .user-info-meta .info-detail span { font-family: var(--font-mono); font-size: 0.7rem; }

/* ============================================================
   文章详情侧边栏布局
   三栏结构：目录（左）| 内容（中）| 侧栏（右）
   ============================================================ */
.article-detail-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.article-detail-sidebar {
    flex: 0 0 200px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* 文章主要内容区域 */
.article-detail-main {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 36px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

/* 侧边栏交互按钮组（纵向排列） */
.sidebar-interactions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}
.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font);
    transition: all var(--transition);
}
.sidebar-btn:hover {
    border-color: var(--primary-border);
    background: var(--primary-light);
    color: var(--primary);
}
/* 已点赞状态 */
.sidebar-btn.liked {
    border-color: var(--danger-border);
    background: var(--danger-light);
    color: var(--danger);
}
.sidebar-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.sidebar-btn-label {
    flex: 1;
    text-align: left;
}
.sidebar-btn-count {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* 侧边栏评论区域 */
.sidebar-comments {
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.sidebar-comments .comment-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.sidebar-comments .comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.sidebar-comments .comment-form textarea {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8rem;
    font-family: var(--font);
    resize: vertical;
    min-height: 36px;
    max-height: 80px;
    transition: border-color var(--transition);
}
.sidebar-comments .comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,226,0.12);
}
.sidebar-comments .comment-form .btn {
    align-self: flex-end;
}
.sidebar-comments .comment-form .login-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}
/* 评论列表 */
.sidebar-comments .comment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.sidebar-comments .comment-item {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}
.sidebar-comments .comment-main-row {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-alt);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-light);
}
.sidebar-comments .comment-main-row .comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--primary);
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-comments .comment-main-row .comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-comments .comment-main-row .comment-body {
    flex: 1;
    min-width: 0;
}
.sidebar-comments .comment-main-row .comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}
.sidebar-comments .comment-main-row .comment-username {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}
.sidebar-comments .comment-main-row .comment-time {
    font-size: 0.62rem;
    color: var(--text-muted);
}
.sidebar-comments .comment-main-row .comment-accountid {
    font-size: 0.58rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 1px 5px;
    border-radius: 3px;
}
.sidebar-comments .comment-main-row .comment-content {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}
.sidebar-comments .comment-empty {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* 响应式：移动端侧边栏改为顶部横向布局 */
@media (max-width: 960px) {
    .article-detail-layout {
        flex-direction: column;
    }
    .article-detail-sidebar {
        flex: none;
        position: static;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        order: 2;
    }
    .article-toc-sidebar {
        flex: none;
        position: static;
        width: 100%;
        max-height: none;
        order: -1;
    }
    .article-toc-sidebar .toc-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }
    .article-toc-sidebar .toc-link {
        padding: 3px 10px;
        font-size: 0.72rem;
        border-left: none;
        border-radius: 14px;
        background: var(--bg-alt);
    }
    .article-toc-sidebar .toc-link.toc-indent-1,
    .article-toc-sidebar .toc-link.toc-indent-2 {
        padding-left: 10px;
        font-size: 0.72rem;
    }
    .sidebar-interactions {
        flex-direction: row;
        flex: 1;
        min-width: 0;
    }
    .sidebar-comments {
        flex: 1 1 100%;
        min-width: 0;
    }
    .article-detail-main {
        padding: 20px 18px;
        order: 1;
    }
}

/* 分享弹窗 */
.share-popup {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    text-align: center;
}
.share-popup.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
.share-popup .share-url {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 6px;
    word-break: break-all;
    user-select: all;
}
.share-popup .share-close {
    display: block;
    margin: 8px auto 0;
    padding: 4px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.78rem;
    transition: all var(--transition);
}
.share-popup .share-close:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 评论删除按钮 */
.comment-delete {
    flex-shrink: 0;
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--transition);
    opacity: 0;
    line-height: 1;
}
.comment-item:hover .comment-delete {
    opacity: 0.6;
}
.comment-delete:hover {
    opacity: 1 !important;
    background: var(--danger-light);
    color: var(--danger);
}

@media (max-width: 480px) {
    .captcha-group { flex-direction: column; }
    .sidebar-comments .comment-form { flex-direction: column; }
    /* 移动端用户模态框适配 */
    .user-tabs { font-size: 0.85rem; }
    .user-tab { padding: 8px 4px; font-size: 0.82rem; }
    .modal-box { padding: 16px 14px 20px; }
    .modal-box.wide { max-width: 100%; margin: 0 6px; }
    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group input[type="tel"] { font-size: 16px !important; padding: 12px 14px; } /* 防止 iOS 自动缩放 */
    /* 移动端用户徽章/下拉菜单 */
    .user-badge { max-width: 140px; overflow: hidden; }
    .user-badge span { overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
    .user-dropdown { right: auto; left: 0; min-width: 160px; }
    /* 修复管理后台按钮换行 */
    .admin-bar .btn-sm { padding: 4px 10px; font-size: 0.7rem; }
    /* 移动端英雄区 */
    .section-inner { padding: 20px 14px; }
    .hero-avatar { width: 64px; height: 64px; font-size: 1.5rem; }
    .hero-name { font-size: 1.15rem; }
    /* 移动端文章详情 */
    .article-detail-main { padding: 16px 14px; }
    .article-detail .article-detail-title { font-size: 1.15rem; }
    /* 移动端评论表单 */
    .sidebar-comments .comment-form textarea { font-size: 16px !important; }
    .sidebar-comments .comment-main-row { padding: 6px 8px; }
    /* 管理后台用户表格横向滚动 */
    #adminUserTableWrap { max-height: 40vh; }
    .admin-user-table { font-size: 0.7rem; }
    .admin-user-table td,
    .admin-user-table th { padding: 6px 6px; }
    .btn-action { font-size: 0.6rem; padding: 2px 5px; }
    .action-cell { gap: 2px; }
    /* 移动端导航改进 */
    .nav-links.open { max-height: 70vh; overflow-y: auto; }
}

/* ============================================================
   管理后台：用户管理
   ============================================================ */
.modal-box-lg { max-width: 900px !important; }

/* 管理后台用户表格 */
.admin-user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.admin-user-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    z-index: 1;
    white-space: nowrap;
}
.admin-user-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.admin-user-table tbody tr:hover {
    background: var(--surface-hover);
}
/* 已封禁用户行 */
.admin-user-table tbody tr.row-banned {
    opacity: 0.55;
    background: var(--danger-light);
}
/* 已禁言用户行 */
.admin-user-table tbody tr.row-muted {
    background: var(--warning-light);
}
.admin-user-table .acct-code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}
.admin-user-table .time-cell {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.admin-user-table .action-cell {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
/* 信息显示/隐藏按钮 */
.admin-user-table .reveal-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.5;
    padding: 2px 4px;
    transition: opacity var(--transition);
    margin-left: 4px;
    vertical-align: middle;
}
.admin-user-table .reveal-btn:hover {
    opacity: 1;
}

/* 操作按钮 */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 500;
    font-family: var(--font);
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.btn-action.unban {
    border-color: var(--success-border);
    color: var(--success);
    background: var(--success-light);
}
.btn-action.unban:hover {
    background: var(--success);
    color: #fff;
}
.btn-action.unmute {
    border-color: var(--success-border);
    color: var(--success);
}
.btn-action.unmute:hover {
    background: var(--success-light);
}
.btn-action.mute {
    border-color: var(--warning-border);
    color: var(--warning);
}
.btn-action.mute:hover {
    background: var(--warning-light);
}
.btn-action.ban {
    border-color: var(--danger-border);
    color: var(--danger);
}
.btn-action.ban:hover {
    background: var(--danger-light);
}
.btn-action.delete {
    color: var(--danger);
    opacity: 0.7;
}
.btn-action.delete:hover {
    opacity: 1;
    border-color: var(--danger);
    background: var(--danger-light);
}

/* 用户状态标签 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
}
.status-badge.normal {
    background: var(--success-light);
    color: var(--success);
}
.status-badge.muted {
    background: var(--warning-light);
    color: var(--warning);
}
.status-badge.banned {
    background: var(--danger-light);
    color: var(--danger);
}

/* 黑名单 */
.blacklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}
.blacklist-item:last-child {
    border-bottom: none;
}
.blacklist-item .blacklist-phone {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text);
}

/* 管理后台栏中的"管理用户"按钮 */
#manageUsersBtn {
    display: inline-flex;
}
#manageUsersBtn svg {
    width: 14px;
    height: 14px;
}

/* ============================================================
   文章目录侧边栏 — 左侧完整目录
   ============================================================ */
.article-toc-sidebar {
    flex: 0 0 220px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    background: var(--surface);
    opacity: var(--panel-opacity);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    font-size: 0.82rem;
}
.toc-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.toc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.toc-link {
    display: block;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.4;
    transition: all var(--transition);
    border-left: 2px solid transparent;
    cursor: pointer;
}
.toc-link:hover {
    background: var(--bg-alt);
    color: var(--primary);
    border-left-color: var(--primary);
}
.toc-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
/* 二级缩进目录项 */
.toc-link.toc-indent-1 {
    padding-left: 20px;
    font-size: 0.77rem;
}
/* 三级缩进目录项 */
.toc-link.toc-indent-2 {
    padding-left: 30px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* ============================================================
   子管理员 / 作者标签
   ============================================================ */
.author-badge-miniadmin {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
}
.author-label-mini {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
}

/* 子管理员行高亮 */
.admin-user-table tbody tr.row-miniadmin {
    background: var(--accent-light);
}
.status-badge.miniadmin {
    background: var(--accent-light);
    color: var(--accent);
}

/* 提升/降级按钮 */
.btn-action.promote {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-action.promote:hover {
    background: var(--accent-light);
}
.btn-action.demote {
    border-color: var(--warning-border);
    color: var(--warning);
}
.btn-action.demote:hover {
    background: var(--warning-light);
}

/* ============================================================
   底部评论区域（文章下方全宽）
   ============================================================ */
.bottom-comments {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}
.bottom-comments-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}
.comment-form-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.comment-form-bottom textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.88rem;
    font-family: var(--font);
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    transition: border-color var(--transition);
}
.comment-form-bottom textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,226,0.12);
}
.comment-form-bottom .btn {
    align-self: flex-end;
}
.comment-form-bottom .login-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.comment-list-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment-list-bottom .comment-item {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}
.comment-list-bottom .comment-main-row {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.comment-list-bottom .comment-main-row .comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--primary);
    overflow: hidden;
    flex-shrink: 0;
}
.comment-list-bottom .comment-main-row .comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.comment-list-bottom .comment-main-row .comment-body {
    flex: 1;
    min-width: 0;
}
.comment-list-bottom .comment-main-row .comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.comment-list-bottom .comment-main-row .comment-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.comment-list-bottom .comment-main-row .comment-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.comment-list-bottom .comment-main-row .comment-accountid {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 1px 5px;
    border-radius: 3px;
}
.comment-list-bottom .comment-main-row .comment-content {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
}
.comment-list-bottom .comment-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================
   评论回复系统
   ============================================================ */
.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 2px 0;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.comment-reply-btn:hover {
    opacity: 1;
    text-decoration: underline;
}
.comment-replies {
    margin-top: 8px;
    padding-left: 44px;
    border-left: 2px solid var(--border-light);
}
.comment-reply-item {
    margin-bottom: 4px;
}
.comment-reply-item .comment-main-row {
    padding: 8px 12px !important;
    background: var(--surface) !important;
    display: flex;
    gap: 10px;
}
.comment-reply-item .comment-main-row .comment-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    overflow: hidden;
}
.comment-reply-item .comment-main-row .comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.comment-reply-item .comment-main-row .comment-body {
    flex: 1;
    min-width: 0;
}
.comment-reply-item .comment-main-row .comment-username {
    font-size: 0.8rem !important;
    font-weight: 600;
    color: var(--text);
}
.comment-reply-item .comment-main-row .comment-content {
    font-size: 0.82rem !important;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}
.comment-reply-item .comment-main-row .comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}
.comment-reply-item .comment-main-row .comment-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.comment-reply-item .comment-main-row .comment-accountid {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 1px 4px;
    border-radius: 3px;
}
/* 行内回复表单 */
.reply-form-inline {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-left: 36px;
}
.reply-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.reply-form-header strong {
    color: var(--text-secondary);
}
.reply-cancel-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    line-height: 1;
}
.reply-cancel-btn:hover {
    color: var(--danger);
}
.reply-textarea {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.82rem;
    font-family: var(--font);
    resize: vertical;
    min-height: 40px;
    max-height: 120px;
    box-sizing: border-box;
    transition: border-color var(--transition);
    margin-bottom: 6px;
}
.reply-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,226,0.12);
}
.reply-submit-btn {
    float: right;
}

/* 侧边栏评论回复样式 */
.sidebar-comments .comment-replies {
    padding-left: 36px;
}
.sidebar-comments .comment-reply-item .comment-main-row {
    padding: 6px 10px !important;
    gap: 6px;
}
.sidebar-comments .comment-reply-item .comment-main-row .comment-avatar {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.6rem !important;
}
.sidebar-comments .comment-reply-item .comment-main-row .comment-username {
    font-size: 0.72rem !important;
}
.sidebar-comments .comment-reply-item .comment-main-row .comment-content {
    font-size: 0.75rem !important;
}
.sidebar-comments .comment-reply-item .comment-main-row .comment-time {
    font-size: 0.58rem !important;
}
.sidebar-comments .reply-form-inline {
    margin-left: 0;
}
.comment-list-bottom .reply-form-inline {
    margin-left: 0;
}
.comment-list-bottom .reply-textarea {
    font-size: 0.85rem;
}
.sidebar-comments .reply-textarea {
    font-size: 0.78rem;
    padding: 6px 10px;
}

/* ============================================================
   页面副标题（用于产品等页面）
   ============================================================ */
.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 图片预览尺寸标签 */
.img-size-label {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    pointer-events: none;
}

/* ============================================================
   产品页面 — 管理工具栏
   ============================================================ */
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 4px;
}

/* 产品卡片 */
.product-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
}
.product-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    padding-top: 0;
    margin-bottom: 0;
}
.product-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}
.product-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.product-card-stats {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px solid var(--border-light);
}
.product-admin-actions {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}
.product-admin-actions .btn-sm {
    font-size: 0.72rem;
    padding: 4px 10px;
}

/* 详情导航栏 */
.detail-nav-bar {
    display: flex;
    align-items: center;
    padding: 4px 0;
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 24px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-ghost:hover {
    background: var(--bg-alt);
    color: var(--primary);
    border-color: var(--primary);
}

/* 产品详情横幅 */
.product-detail-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-top: 8px;
}
.product-detail-header {
    margin-bottom: 16px;
}
.product-detail-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--text);
}
.product-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.product-detail-desc {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.product-detail-extra {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.detail-info-row {
    display: flex;
    gap: 8px;
}
.detail-info-label {
    color: var(--text-muted);
    min-width: 80px;
}
.detail-info-value {
    color: var(--text);
}
.product-detail-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.btn-lg {
    padding: 12px 32px !important;
    font-size: 1rem !important;
    gap: 10px !important;
    border-radius: 12px !important;
}

/* 产品交互栏 */
.product-interaction-bar {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    margin-top: 8px;
}
.interact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font);
    font-weight: 500;
    transition: all var(--transition);
}
.interact-btn:hover {
    background: var(--bg-alt);
    border-color: var(--primary);
    color: var(--primary);
}
.interact-active {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
    background: var(--danger-light) !important;
}

/* 产品 readme 区块 */
.product-readme-section {
    margin: 20px 0;
    padding: 20px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}
.product-readme-content {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.product-readme-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

/* 产品详情评论区间距 */
.product-detail-comments {
    margin-top: 8px;
}
.comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

/* 产品文件夹上传区域 — 与 md-media-upload-area 一致 */
.product-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    margin-top: 6px;
}
.product-upload-area:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}
.product-upload-area.has-files {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-light);
}

/* 产品文件列表（文件夹上传后） */
.product-file-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-alt);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-light);
}
.product-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-radius: 4px;
}

/* 产品文件选择器（单选样式，用于主文件/readme） */
.product-file-selector {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    max-height: 150px;
    overflow-y: auto;
    padding: 6px;
    background: var(--bg-alt);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-light);
}
.product-file-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.product-file-option:hover {
    border-color: var(--primary-border);
    background: var(--primary-light);
}
.product-file-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.product-file-option input[type="radio"] {
    display: none;
}
.product-file-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

/* ============================================================
   回到顶部/底部浮动按钮组
   ============================================================ */
.scroll-buttons {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}
.scroll-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.scroll-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.scroll-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   目录响应式 — 已在上面 960px 断点处处理
   ============================================================ */

/* ============================================================
   日志页面 — 项目与更新日志样式
   ============================================================ */

/* 项目信息卡片（在更新日志级别展示） */
.project-info-card {
    margin-top: 8px;
    padding: 12px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.project-info-text {
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.5;
}
.project-info-url {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 0.8rem;
    text-decoration: none;
    word-break: break-all;
}
.project-info-url:hover {
    text-decoration: underline;
}

/* 项目卡片 URL 标签 */
.project-url-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 更新日志卡片摘要 */
.log-summary {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 更新日志详情正文 */
.changelog-detail-body {
    font-size: 0.95rem;
    line-height: 1.7;
}
.changelog-detail-body h1,
.changelog-detail-body h2,
.changelog-detail-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text);
}
.changelog-detail-body h1 { font-size: 1.5rem; }
.changelog-detail-body h2 { font-size: 1.25rem; }
.changelog-detail-body h3 { font-size: 1.1rem; }
.changelog-detail-body p {
    margin-bottom: 0.8em;
}
.changelog-detail-body ul,
.changelog-detail-body ol {
    margin-bottom: 0.8em;
    padding-left: 1.5em;
}
.changelog-detail-body li {
    margin-bottom: 0.3em;
}
.changelog-detail-body pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.4;
}
.changelog-detail-body code {
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
}
.changelog-detail-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}
.changelog-detail-body blockquote {
    border-left: 3px solid var(--primary);
    padding: 8px 16px;
    margin: 12px 0;
    background: var(--bg-alt);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.changelog-detail-body img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    cursor: pointer;
}
.changelog-detail-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}
.changelog-detail-body th,
.changelog-detail-body td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    font-size: 0.85rem;
}
.changelog-detail-body th {
    background: var(--bg-alt);
    font-weight: 600;
}
.changelog-detail-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}
.changelog-detail-body a {
    color: var(--primary);
    text-decoration: none;
}
.changelog-detail-body a:hover {
    text-decoration: underline;
}

/* 日志卡片悬停效果 */
.log-card {
    transition: all var(--transition);
}
.log-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* 响应式：移动端日志卡片摘要 */
@media (max-width: 640px) {
    .log-summary {
        -webkit-line-clamp: 2;
    }
}
