﻿/* ============================================================
   全站主样式文件
   包含：全局重置、布局容器、导航、文章卡片、页脚、响应式适配
   ============================================================ */

/* ============================================================
   1. CSS 变量体系（统一颜色、间距、圆角、阴影）
   ============================================================ */
:root {
    /* 主色调 */
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --primary-light: #e6f0fa;

    /* 文本颜色 */
    --text: #1e1e1e;
    --text-secondary: #666666;
    --text-hint: #999999;
    --text-inverse: #ffffff;

    /* 背景色 */
    --bg-page: #fafafa;
    --bg-container: rgba(255, 255, 255, 0.92);
    --bg-card: #ffffff;
    --bg-hover: #f5f5f5;
    --bg-code: #f5f5f5;

    /* 边框 */
    --border: #e8e8e8;
    --border-light: #f0f0f0;

    /* 功能色 */
    --success: #4CAF50;
    --success-bg: #e8f5e9;
    --warning: #ff9800;
    --warning-bg: #fff3e0;
    --danger: #f44336;
    --danger-bg: #ffebee;
    --info: #2196F3;
    --info-bg: #e3f2fd;

    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 20px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-sm: 0.85rem;
    --font-size-base: 0.95rem;
    --font-size-lg: 1.1rem;

    /* 导航 */
    --nav-bg: #ffffff;
    --nav-border: #e8e8e8;
}

/* 深色模式变量覆盖 */
.dark-mode {
    --text: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-hint: #707070;
    --bg-page: #1a1a1a;
    --bg-container: rgba(30, 34, 40, 0.92);
    --bg-card: #252a30;
    --bg-hover: #2d3339;
    --bg-code: #2d2d2d;
    --border: #3a3a3a;
    --border-light: #333333;
    --nav-bg: #252a30;
    --nav-border: #3a3a3a;
}

/* 暖调阅读风格主题 */
.theme-warm {
    /* 主色调：暖琥珀 */
    --primary: #b45309;
    --primary-hover: #92400e;
    --primary-light: #fef3c7;

    /* 文本：深棕 */
    --text: #3d2c1e;
    --text-secondary: #78716c;
    --text-hint: #a8a29e;
    --text-inverse: #fffdf8;

    /* 背景：奶油米白 */
    --bg-page: #faf6f0;
    --bg-container: rgba(255, 253, 248, 0.95);
    --bg-card: #fffdf8;
    --bg-hover: #f5efe6;
    --bg-code: #f5efe6;

    /* 边框：暖灰 */
    --border: #e8dfd3;
    --border-light: #f0e9dd;

    /* 功能色 */
    --success: #65a30d;
    --success-bg: #ecfccb;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0891b2;
    --info-bg: #cffafe;

    /* 字体：衬线体，更适合阅读 */
    --font-family: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;

    /* 导航 */
    --nav-bg: #fffdf8;
    --nav-border: #e8dfd3;

    /* 阴影更柔和 */
    --shadow-sm: 0 1px 3px rgba(61, 44, 30, 0.06);
    --shadow-md: 0 1px 20px rgba(61, 44, 30, 0.04);
    --shadow-lg: 0 4px 12px rgba(61, 44, 30, 0.08);
}

/* 暖调主题下的文章内容特殊优化 */
.theme-warm .article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    letter-spacing: 0.02em;
}
.theme-warm .article-content h1,
.theme-warm .article-content h2,
.theme-warm .article-content h3 {
    font-weight: 700;
    letter-spacing: 0.01em;
}
.theme-warm .article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    padding: 12px 20px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
.theme-warm .article-content code {
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "SF Mono", Consolas, monospace;
}
.theme-warm .article-content pre {
    background: #2d2419;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}
.theme-warm .article-content pre code {
    background: transparent;
    color: #e8dfd3;
    padding: 0;
}

/* 暖调主题下的切换按钮 */
.theme-warm .dark-mode-toggle {
    background: #fffdf8;
    border-color: #e8dfd3;
    color: #b45309;
}
.theme-warm .dark-mode-toggle:hover {
    background: #b45309;
    color: #fffdf8;
    border-color: #b45309;
}

/* ========== 全局重置 & 基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.6;
    padding: var(--space-lg);
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ========== 通用 Utility 类（抽离高频内联样式） ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-sm { font-size: var(--font-size-sm); }
.text-muted { color: var(--text-secondary); }
.text-hint { color: var(--text-hint); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }

.bg-light { background: var(--bg-hover); }
.bg-success { background: var(--success-bg); }
.bg-warning { background: var(--warning-bg); }
.bg-danger { background: var(--danger-bg); }
.bg-info { background: var(--info-bg); }

.border { border: 1px solid var(--border); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-xs); }
.gap-2 { gap: var(--space-sm); }
.gap-3 { gap: var(--space-md); }

.hidden { display: none; }
.w-full { width: 100%; }

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-container);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    padding: var(--space-xl) var(--space-2xl);
    border-radius: 0;
    box-shadow: var(--shadow-md);
}

.dark-mode .container {
    background: var(--bg-container);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-md) var(--space-lg);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .dark-mode .container {
        background: rgba(26, 30, 36, 0.96);
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--space-sm) var(--space-md);
    }
}

/* ========== 站点标题 ========== */
.site-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 var(--space-xs) 0;
    text-align: center;
}
.site-title a {
    color: var(--text);
}
.site-title i {
    margin-right: 6px;
    color: var(--primary);
}

.container > p[style] {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-lg);
}

/* ========== 导航栏 ========== */
#main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm) var(--space-md);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-xl);
    background: var(--nav-bg);
}
#main-nav a {
    color: var(--text);
    font-size: var(--font-size-base);
    padding: var(--space-xs) 2px;
    white-space: nowrap;
    transition: color 0.15s;
}
#main-nav a:hover {
    color: var(--primary);
    text-decoration: none;
}
#main-nav .search-wrapper {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
}
#main-nav .search-wrapper form {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
#main-nav .search-wrapper input[type="text"] {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    background: var(--bg-card);
    color: var(--text);
    width: 160px;
    transition: width 0.2s, border-color 0.2s;
}
#main-nav .search-wrapper input[type="text"]:focus {
    width: 200px;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}
#main-nav .search-wrapper button {
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
#main-nav .search-wrapper button:hover {
    background: var(--primary-hover);
}

/* 搜索建议 */
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}
.search-suggestions a {
    display: block;
    padding: 8px 12px;
    color: #1e1e1e;
    border-bottom: 1px solid #f0f0f0;
}
.search-suggestions a:hover,
.search-suggestions a.active {
    background: #f0f7ff;
}
.suggestion-title {
    font-weight: 500;
}
.suggestion-excerpt {
    font-size: 0.85rem;
    color: #666;
}
.suggestion-date {
    font-size: 0.75rem;
    color: #999;
}
.no-result {
    padding: 12px;
    color: #999;
    text-align: center;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #ccc;
    padding: 6px 14px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 12px;
    width: 100%;
    text-align: center;
    background: #f5f5f5;
}
.menu-toggle:hover {
    background: #e8e8e8;
}

/* ========== 轮播 ========== */
.carousel-section {
    margin: var(--space-lg) 0;
}
.carousel-container {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}
.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.carousel-slide {
    flex: 0 0 100%;
    padding: 28px 32px;
    min-height: 160px;
    position: relative;
}
.carousel-slide::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-hover));
}
.carousel-slide a {
    display: block;
    color: inherit;
    text-decoration: none;
}
.carousel-card {
    position: relative;
    padding-left: 8px;
}
.carousel-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 10px;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.carousel-badge-hot { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.carousel-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text);
    line-height: 1.4;
}
.carousel-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0 0 12px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.carousel-stats {
    font-size: 0.85rem;
    color: var(--text-hint);
    display: flex;
    gap: 16px;
}
.carousel-stats i { margin-right: 4px; }
.carousel-action {
    display: inline-block;
    margin-top: 14px;
    font-weight: 500;
    color: var(--primary);
    font-size: 0.9rem;
}
.carousel-action i {
    transition: transform 0.2s;
    margin-left: 4px;
}
.carousel-action:hover i {
    transform: translateX(4px);
}
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0 16px 0;
}
.carousel-dot {
    width: 24px;
    height: 4px;
    border: none;
    border-radius: 2px;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}
.carousel-dot.active {
    background: var(--primary);
    width: 32px;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.carousel-arrow:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
/* ========== 文章列表（首页） ========== */
.article-card {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
    transition: background 0.15s;
}
.article-card:hover {
    background: var(--bg-hover);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: var(--radius-md);
}
.article-card:last-child {
    border-bottom: none;
}
.article-info {
    flex: 1;
    min-width: 0;
}
.article-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 var(--space-xs) 0;
}
.article-info h3 a {
    color: var(--text);
}
.article-info h3 a:hover {
    color: var(--primary);
    text-decoration: none;
}
.top-badge {
    display: inline-block;
    background: var(--warning);
    color: var(--text-inverse);
    font-size: 0.7rem;
    padding: 1px 10px;
    margin-left: var(--space-sm);
    vertical-align: middle;
    border-radius: var(--radius-sm);
}
.article-info p {
    margin: var(--space-xs) 0;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}
.article-info p .tag {
    display: inline-block;
    background: var(--bg-hover);
    padding: 0 var(--space-sm);
    margin-right: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}
.article-info p .tag:hover {
    background: #d0d0d0;
    text-decoration: none;
}
.article-info small {
    color: #888;
    font-size: 0.8rem;
}
.article-thumb {
    flex: 0 0 150px;
    width: 120px;
    height: 100px;
    background: #e8e8e8;
    position: relative;
    overflow: hidden;
}
.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.article-thumb img.lazy-load {
    opacity: 0;
}
.article-thumb img.lazy-loaded {
    opacity: 1;
    transition: opacity 0.3s;
}
.thumb-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}
.thumb-loader.loaded {
    display: none;
}
.thumb-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.thumb-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    color: #aaa;
    font-size: 2rem;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 20px 0 0 0;
    padding: 8px 0;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    min-width: 32px;
    text-align: center;
    color: #333;
}
.pagination a:hover {
    background: #f0f0f0;
    border-color: #bbb;
    text-decoration: none;
}
.pagination .current {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
}
.pagination .dots {
    border: none;
    padding: 4px 8px;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    padding: 16px 0 8px 0;
}
.footer p {
    margin: 6px 0;
}
.footer a {
    color: #0066cc;
}

/* ========== 返回顶部按钮 ========== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 10px 14px;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    z-index: 999;
}
.back-to-top.show {
    display: block;
}
.back-to-top:hover {
    background: #004d99;
}

/* ========== 通用分隔线 ========== */
hr {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 12px 0;
}

/* ========== 标签云（tags.php） ========== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 0;
    justify-content: center;
}
.tag-cloud a {
    display: inline-block;
    padding: 4px 14px;
    background: #f0f2f5;
    color: #1e1e1e !important;    /* 覆盖内联颜色 */
    border: 1px solid #d0d0d0;
    border-radius: 0;
    text-decoration: none;
    font-weight: 400;
    transition: background 0.15s;
    font-size: 0.95rem;           /* 基准大小，内联 style 会覆盖 */
}
.tag-cloud a:hover {
    background: #e0e4e8;
    border-color: #aaa;
    text-decoration: none;
}
.tag-cloud a i {
    margin-right: 4px;
    color: #888;
}

/* ========== 归档页（archive.php） ========== */
.container .archive-list,
.container p > a[href*="page=archive"] {
    display: inline-block;
    padding: 2px 0;
    font-size: 1rem;
    color: #1e1e1e;
}
.container p > a[href*="page=archive"]:hover {
    color: #0066cc;
    text-decoration: none;
}
.container h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 16px 0 4px 0;
}
.container h3 a {
    color: #1e1e1e;
}
.container h3 a:hover {
    color: #0066cc;
    text-decoration: none;
}
.container h3 span {
    font-weight: normal;
    font-size: 0.85em;
    color: #888;
    margin-left: 6px;
}
.container h3 + p {
    margin: 2px 0 4px 0;
    color: #444;
    font-size: 0.95rem;
}
.container h3 + p + small {
    color: #999;
    font-size: 0.8rem;
}
.container p i.fa-regular.fa-face-frown {
    margin-right: 6px;
}

/* ========== 日记页（diary.php） ========== */
/* ========== 日记卡片（纯文本版） ========== */
.diary-card {
    border-bottom: 1px solid #e8e8e8;
    padding: 14px 0;
    transition: padding 0.2s;
}
.diary-card:last-child {
    border-bottom: none;
}

/* 标题 */
.diary-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 2px 0;
    line-height: 1.4;
}
.diary-card h3 a {
    color: #1e1e1e;
    text-decoration: none;
    transition: color 0.15s;
}
.diary-card h3 a:hover {
    color: #0066cc;
    text-decoration: none;
}
.diary-card h3 a i {
    color: #999;
    font-size: 0.85rem;
    margin-right: 4px;
}

/* 日期 */
.diary-card .diary-meta {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 2px;
}
.diary-card .diary-meta i {
    margin-right: 2px;
}

/* 摘要 */
.diary-card .diary-excerpt {
    color: #444;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 2px 0 0 0;
}

/* ----- 深色模式 ----- */
.dark-mode .diary-card {
    border-color: #333;
}
.dark-mode .diary-card h3 a {
    color: #e0e0e0;
}
.dark-mode .diary-card h3 a:hover {
    color: #66b3ff;
}
.dark-mode .diary-card .diary-meta {
    color: #888;
}
.dark-mode .diary-card .diary-excerpt {
    color: #bbb;
}

/* ----- 移动端适配 ----- */
@media (max-width: 768px) {
    .diary-card {
        padding: 12px 0;
    }
    .diary-card h3 {
        font-size: 1rem;
    }
    .diary-card .diary-excerpt {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .diary-card {
        padding: 10px 0;
    }
    .diary-card h3 {
        font-size: 0.95rem;
    }
    .diary-card .diary-meta {
        font-size: 0.7rem;
    }
    .diary-card .diary-excerpt {
        font-size: 0.8rem;
    }
}

/* ========== 留言板（guestbook.php） ========== */
/* 提交按钮 */
.gb-submit-btn {
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
}
.gb-submit-btn:hover {
    background: #004d99;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.gb-submit-btn:active {
    transform: translateY(0);
}

/* 回复链接 */
.gb-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    color: #0066cc;
    text-decoration: none;
    background: #e8f0fe;
    transition: all 0.15s;
}
.gb-reply-link:hover {
    background: #0066cc;
    color: #fff;
    text-decoration: none;
}

/* emoji 切换按钮 */
#emoji-toggle {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
#emoji-toggle:hover {
    background: #E3F2FD;
    color: #0066cc;
    border-color: #90CAF9;
}

/* emoji 面板 */
.emoji-panel {
    display: none;
    flex-wrap: wrap;
    gap: 1px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    margin: 4px 0 8px 0;
    max-width: 380px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}
.emoji-btn {
    background: none;
    border: 1px solid transparent;
    font-size: 18px;
    cursor: pointer;
    padding: 1px 2px;
    border-radius: 4px;
    line-height: 1.2;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}
.emoji-btn:hover {
    background: #E3F2FD;
    border-color: #90CAF9;
}

.gb-body {
    word-break: break-word;
}

/* 留言列表样式（保持简洁） */
.guestbook-list ul {
    list-style: none;
    padding-left: 0;
}
.guestbook-list li {
    border-bottom: 1px dotted #ccc;
    padding: 8px 0;
}

/* ========== 响应式布局 ========== */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    .container {
        padding: 12px 14px;
    }
    .site-title {
        font-size: 1.4rem;
    }
    #main-nav {
        flex-direction: column;
        align-items: stretch;
        display: none;
        border: none;
        padding: 0 0 12px 0;
        margin-bottom: 8px;
    }
    #main-nav.show {
        display: flex;
    }
    #main-nav a {
        padding: 8px 4px;
        border-bottom: 1px solid #f0f0f0;
        white-space: normal;
    }
    #main-nav .search-wrapper {
        margin-left: 0;
        margin-top: 8px;
        flex-wrap: wrap;
    }
    #main-nav .search-wrapper form {
        width: 100%;
    }
    #main-nav .search-wrapper input[type="text"] {
        flex: 1;
        width: auto;
    }
    #main-nav .search-wrapper input[type="text"]:focus {
        width: auto;
    }
    .menu-toggle {
        display: block;
    }
    .carousel-slide {
        padding: 16px;
        min-height: 120px;
    }
    .carousel-title {
        font-size: 1.1rem;
    }
    .carousel-arrow {
        padding: 4px 8px;
        font-size: 1rem;
    }
    .article-card {
        flex-direction: column;
        gap: 8px;
        padding: 14px 0;
    }
    .article-thumb {
        flex: 0 0 auto;
        width: 100%;
        height: 140px;
    }
    .article-info h3 {
        font-size: 1.1rem;
    }
    .pagination a,
    .pagination span {
        padding: 4px 10px;
        font-size: 0.85rem;
    }
    .container h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px 10px;
    }
    .article-thumb {
        height: 120px;
    }
    .carousel-slide {
        padding: 12px;
        min-height: 100px;
    }
    .tag-cloud {
        gap: 6px 10px;
    }
    .tag-cloud a {
        padding: 3px 12px;
        font-size: 0.9rem;
    }
    .diary-thumb {
        height: 140px;
    }
}

/* ========== 文章评论区（article.php） ========== */

/* 评论区容器 */
/* #comment-form 旧样式已由 .comment-form-wrapper 替代 */
/* 消息提示（成功/错误） */
.message {
    padding: 8px 12px;
    background: #f5f5f5;
    border-left: 3px solid #0066cc;
    margin: 8px 0;
}
.message i {
    margin-right: 6px;
}

/* emoji 切换按钮（覆盖内联样式，保持统一） */
#emoji-toggle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
#emoji-toggle:hover {
    background: #E3F2FD;
    color: #0066cc;
}

/* emoji 面板 */
.emoji-panel {
    display: none;  /* 由 JS 控制显示为 flex */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    margin: 4px 0 8px 0;
    max-width: 400px;
    flex-wrap: wrap;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
}
.emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
}
.emoji-btn:hover {
    background: #E3F2FD;
    transform: scale(1.2);
}

/* 评论区关闭提示（内联样式已包含，这里做补充） */
[style*="background:#FFF3E0"] {
    border-radius: 0;  /* 保持直角，更简洁 */
}

/* 移动端自适应 */
@media (max-width: 768px) {
    .comment-form-wrapper input[type="text"],
    .comment-form-wrapper input[type="email"],
    .comment-form-wrapper input[type="url"],
    .comment-form-wrapper textarea {
        font-size: 0.9rem;
    }
    .comment-form-wrapper button[type="submit"],
    .comment-form-wrapper input[type="submit"] {
        width: 100%;
        padding: 10px;
    }
    .cm-badge-link {
        font-size: 0.7rem;
        padding: 0 6px;
    }
    .emoji-panel {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .comment-form-wrapper input,
    .comment-form-wrapper textarea {
        font-size: 0.85rem;
    }
    .emoji-btn {
        font-size: 18px;
        padding: 3px 4px;
    }
}

/* ========== 文章详情页（article.php） ========== */

/* 文章元信息（日期、阅读量、评论数、作者） */
.article-meta {
    color: #888;
    font-size: 0.9rem;
    margin: 4px 0 8px 0;
}
.article-meta i {
    margin-right: 2px;
}

/* 文章标签（详情页） */
.article-tags {
    margin: 6px 0 12px 0;
}
.article-tags .tag {
    display: inline-block;
    background: #e8e8e8;
    padding: 0 10px;
    margin-right: 4px;
    font-size: 0.8rem;
    color: #333;
}
.article-tags .tag:hover {
    background: #d0d0d0;
    text-decoration: none;
}

/* ========== 文章目录（TOC） ========== */
.article-toc {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 20px 0;
    transition: box-shadow 0.2s;
}
.article-toc:hover {
    box-shadow: var(--shadow-sm);
}
.toc-details { display: block; }
.toc-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}
.toc-summary::-webkit-details-marker { display: none; }
.toc-icon { color: var(--primary); font-size: 0.9rem; }
.toc-title { flex: 1; }
.toc-count {
    font-size: 0.7rem;
    color: var(--text-hint);
    font-weight: 400;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
}
.toc-arrow {
    font-size: 0.7rem;
    color: var(--text-hint);
    transition: transform 0.3s ease;
}
.toc-details[open] .toc-arrow { transform: rotate(180deg); }
.toc-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    max-height: 400px;
    overflow-y: auto;
}
.toc-list li { padding: 1px 0; }
.toc-level-2 { padding-left: 0; }
.toc-level-3 { padding-left: 16px; }
.toc-level-4 { padding-left: 32px; }
.toc-link {
    display: block;
    padding: 4px 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.5;
}
.toc-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
    padding-left: 14px;
}
.toc-link.active {
    background: var(--primary);
    color: #fff;
    font-weight: 500;
}
/* ========== 文章正文 ========== */
.article-content {
    line-height: 1.8;
    font-size: 1rem;
}
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 1.2em 0 0.4em 0;
    font-weight: 600;
    line-height: 1.4;
}
.article-content h1 { font-size: 1.7rem; }
.article-content h2 { font-size: 1.4rem; }
.article-content h3 { font-size: 1.2rem; }
.article-content h4 { font-size: 1.05rem; }
.article-content p {
    margin: 0 0 0.8em 0;
}
.article-content img {
    max-width: 100%;
    height: auto;
}
.article-content blockquote {
    margin: 0.8em 0;
    padding: 0.4em 1em;
    border-left: 3px solid #0066cc;
    background: #f6f8fa;
    color: #444;
}
.article-content ul,
.article-content ol {
    padding-left: 1.5em;
    margin: 0.4em 0 0.8em 0;
}
.article-content li {
    margin: 0.2em 0;
}
.article-content code {
    background: var(--bg-code);
    color: #d63384;
    padding: 0.15em 0.4em;
    font-size: 0.875em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.article-content pre {
    background: var(--bg-code);
    padding: var(--space-lg);
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 0.8em 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    line-height: 1.6;
}
.article-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: inherit;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.95rem;
}
.article-content .table-wrapper {
    overflow-x: auto;
    margin: 0.8em 0;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.article-content th,
.article-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    word-break: break-word;
    white-space: nowrap;
}
.article-content th {
    background: var(--bg-hover);
    font-weight: 600;
}
.article-content tr:nth-child(even) {
    background: var(--bg-hover);
}
.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5em 0;
}
/* 数学公式容器 */
.article-content .math-block {
    overflow-x: auto;
    padding: var(--space-md) 0;
    margin: 0.8em 0;
    text-align: center;
}
.article-content .MathJax,
.article-content .katex {
    font-size: 1.05em;
}

/* ========== 分享按钮 ========== */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 12px 0 8px 0;
    border-top: 1px solid #e8e8e8;
    margin-top: 20px;
    align-items: center;
}
.share-buttons > span {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 0.8rem;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
}
.share-btn:hover {
    text-decoration: none;
    background: #f5f5f5;
    border-color: #bbb;
}
.share-btn i {
    font-size: 0.85rem;
}
.share-weibo { border-color: #e6162d; color: #e6162d; }
.share-weibo:hover { background: #e6162d; color: #fff; border-color: #e6162d; }
.share-qq { border-color: #12b7f5; color: #12b7f5; }
.share-qq:hover { background: #12b7f5; color: #fff; border-color: #12b7f5; }
.share-twitter { border-color: #1da1f2; color: #1da1f2; }
.share-twitter:hover { background: #1da1f2; color: #fff; border-color: #1da1f2; }
.share-facebook { border-color: #1877f2; color: #1877f2; }
.share-facebook:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-wechat { border-color: #07c160; color: #07c160; }
.share-wechat:hover { background: #07c160; color: #fff; border-color: #07c160; }
.share-copy { border-color: #666; color: #666; }
.share-copy:hover { background: #666; color: #fff; border-color: #666; }
.share-copy.copied {
    border-color: #28a745;
    color: #28a745;
    background: #f0fff4;
}
.share-copy.copied:hover {
    background: #28a745;
    color: #fff;
}

/* ========== 微信分享弹窗 ========== */
#wechat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#wechat-modal .modal-box {
    background: #fff;
    padding: 24px 28px 20px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    position: relative;
}
#wechat-modal .modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
#wechat-modal .modal-close:hover {
    color: #333;
}
#wechat-modal .modal-title {
    font-weight: 600;
    margin: 0 0 14px 0;
    font-size: 1rem;
}
#wechat-modal .modal-title i {
    color: #07c160;
}
#wechat-qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    min-height: 200px;
}
#wechat-modal .modal-hint {
    font-size: 0.75rem;
    color: #999;
    margin: 0;
}

/* ========== 上一篇 / 下一篇导航 ========== */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    margin: 16px 0 8px 0;
}
.article-nav a {
    display: flex;
    flex-direction: column;
    max-width: 45%;
    padding: 4px 0;
    color: #1e1e1e;
}
.article-nav a:hover {
    text-decoration: none;
    color: #0066cc;
}
.nav-label {
    font-size: 0.75rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-prev {
    align-items: flex-start;
}
.nav-next {
    align-items: flex-end;
    text-align: right;
}

/* ========== 相关文章 ========== */
.related-articles {
    margin: 16px 0 8px 0;
}
.related-articles h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}
.related-articles h3 i {
    color: #0066cc;
    margin-right: 6px;
}
.related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}
.related-list a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1e1e1e;
    font-size: 0.9rem;
    padding: 2px 0;
}
.related-list a:hover {
    color: #0066cc;
    text-decoration: none;
}
.related-list a i {
    color: #999;
    font-size: 0.8rem;
}

/* ========== 文章不存在提示 ========== */
.article-not-found {
    padding: 20px 0;
    color: #888;
}
.article-not-found i {
    margin-right: 6px;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .article-toc { padding: 10px 14px; }
    .toc-link { font-size: 0.82rem; padding: 3px 8px; }
    .share-buttons {
        gap: 4px 6px;
        padding: 10px 0 6px 0;
    }
    .share-btn {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    .share-btn i {
        font-size: 0.75rem;
    }
    .article-nav {
        flex-direction: column;
        gap: 8px;
    }
    .article-nav a {
        max-width: 100%;
    }
    .nav-next {
        align-items: flex-start;
        text-align: left;
    }
    .nav-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    #wechat-modal .modal-box {
        padding: 20px 20px 16px;
        max-width: 300px;
    }
    #wechat-qrcode {
        min-height: 160px;
    }
    .related-list {
        flex-direction: column;
        gap: 2px;
    }
    .article-content {
        font-size: 0.95rem;
    }
    .article-content h1 { font-size: 1.4rem; }
    .article-content h2 { font-size: 1.2rem; }
    .article-content h3 { font-size: 1.05rem; }
}

@media (max-width: 480px) {
    .share-buttons {
        gap: 4px;
    }
    .share-btn {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    .share-btn i {
        font-size: 0.7rem;
    }
    .article-toc { padding: 8px 12px; }
    .toc-summary { font-size: 0.88rem; }
    .toc-link { font-size: 0.78rem; padding: 3px 6px; }
}

/* ========== 友链页面（links.php） ========== */

/* ===== 友链卡片列表 ===== */
.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 16px 0;
}
.link-card {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    padding: 14px 16px;
    transition: background 0.15s;
}
.link-card:hover {
    background: #f0f1f2;
}
.link-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.link-card h3 a {
    color: #1e1e1e;
}
.link-card h3 a:hover {
    color: #0066cc;
    text-decoration: none;
}
.link-card h3 a i {
    font-size: 0.8rem;
    color: #999;
    margin-right: 4px;
}
.link-card p {
    margin: 4px 0;
    font-size: 0.9rem;
    color: #555;
}
.link-url {
    font-size: 0.8rem;
    color: #999;
    word-break: break-all;
    margin: 2px 0 4px 0;
}
.link-url i {
    margin-right: 4px;
}
.link-tag {
    display: inline-block;
    background: #e8e8e8;
    padding: 0 10px;
    font-size: 0.75rem;
    color: #555;
}
.link-tag i {
    margin-right: 4px;
}

/* 卡片内状态指示灯（存活/失效） */
.link-card h3 span[style*="border-radius:50%"] {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== RSS 文章聚合 ===== */
.rss-aggregation {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 16px 20px;
    margin: 16px 0;
    overflow: hidden;
}
.rss-aggregation .rss-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.rss-aggregation .rss-header h3 {
    margin: 0;
    color: #166534;
    font-size: 1.05rem;
    border-bottom: none;
    padding-bottom: 0;
}
.rss-aggregation .rss-header h3 i {
    color: #16a34a;
    margin-right: 6px;
}
.rss-aggregation .rss-header a {
    font-size: 0.85rem;
    color: #16a34a;
}
.rss-aggregation .rss-header a:hover {
    text-decoration: none;
}
.rss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 12px;
}
.rss-item {
    background: #fff;
    border: 1px solid #dcfce7;
    padding: 12px 14px;
    transition: border-color 0.15s;
}
.rss-item:hover {
    border-color: #86efac;
}
.rss-item .rss-site {
    font-size: 0.8rem;
    color: #16a34a;
    margin-bottom: 2px;
}
.rss-item .rss-site a {
    color: #16a34a;
    font-weight: 600;
}
.rss-item .rss-site a:hover {
    text-decoration: none;
}
.rss-item h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-word;
}
.rss-item h4 a {
    color: #1e1e1e;
}
.rss-item h4 a:hover {
    color: #0066cc;
    text-decoration: none;
}
.rss-item small {
    color: #999;
    font-size: 0.75rem;
}
.rss-item small i {
    margin-right: 2px;
}

/* 无RSS文章时的占位提示 */
.rss-empty {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 16px 20px;
    margin: 16px 0;
    text-align: center;
}
.rss-empty p {
    color: #166534;
    margin: 0;
}
.rss-empty p i {
    margin-right: 6px;
}

/* ===== 本站信息模块 ===== */
.site-info-module {
    background: #e8f0fe;
    border: 1px solid #90caf9;
    padding: 14px 18px;
    margin-bottom: 16px;
    overflow: hidden;
}
.site-info-module h3 {
    margin: 0 0 6px 0;
    color: #1565c0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.05rem;
}
.site-info-module h3 i {
    margin-right: 6px;
}
.site-info-module > p {
    margin: 4px 0;
    color: #424242;
    font-size: 0.9rem;
}
.site-info-module .info-box {
    background: #ffffff;
    border: 1px solid #bbdefb;
    padding: 10px 12px;
    margin-top: 8px;
}
.site-info-module .info-box table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.site-info-module .info-box table td {
    padding: 4px 8px;
    vertical-align: top;
}
.site-info-module .info-box table td:first-child {
    color: #757575;
    white-space: nowrap;
    width: 80px;
}
.site-info-module .info-box table td:last-child {
    color: #1e1e1e;
    word-break: break-all;
}
.site-info-module .info-box table td:last-child a {
    color: #1565c0;
}
.site-info-module .info-box table td:last-child a:hover {
    text-decoration: none;
}
.site-info-module .info-box table td img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}
.site-info-module .info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.site-info-module .info-actions button {
    background: #4caf50;
    color: #fff;
    border: none;
    font-size: 0.85rem;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.site-info-module .info-actions button:hover {
    background: #388e3c;
}
.site-info-module .info-actions button i {
    margin-right: 4px;
}
#copy-feedback {
    display: none;
    color: #4caf50;
    font-size: 0.85rem;
    line-height: 36px;
}
#copy-feedback i {
    margin-right: 4px;
}

/* ===== 友链申请表单 ===== */
.link-form-section {
    margin-top: 20px;
    padding-top: 8px;
}
.link-form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}
.link-form-section h3 i {
    margin-right: 6px;
    color: #0066cc;
}
.link-form-section .note {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 12px 0;
}
.link-form-section .note i {
    margin-right: 4px;
}
.link-form-section label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 10px 0 2px 0;
}
.link-form-section label span {
    color: #d32f2f;
}
.link-form-section input[type="text"],
.link-form-section input[type="email"],
.link-form-section textarea {
    width: 100%;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-size: 0.95rem;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
}
.link-form-section input[type="text"]:focus,
.link-form-section input[type="email"]:focus,
.link-form-section textarea:focus {
    border-color: #0066cc;
    outline: none;
}
.link-form-section textarea {
    resize: vertical;
    min-height: 60px;
}
.link-form-section .captcha-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.link-form-section .captcha-row input[type="text"] {
    width: 140px;
    margin-bottom: 0;
}
.link-form-section .captcha-row img {
    cursor: pointer;
    border: 1px solid #ccc;
}
.link-form-section .captcha-row img:hover {
    border-color: #999;
}
.link-form-section .captcha-row span {
    font-size: 0.8rem;
    color: #888;
}
.link-form-section button[type="submit"] {
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 8px 22px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s;
}
.link-form-section button[type="submit"]:hover {
    background: #004d99;
}
.link-form-section button[type="submit"] i {
    margin-right: 6px;
}

/* 错误消息 */
.error-msg {
    padding: 8px 12px;
    background: #fef2f2;
    border-left: 3px solid #d32f2f;
    color: #b71c1c;
    margin: 8px 0;
}
.error-msg i {
    margin-right: 6px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .link-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .link-card {
        padding: 12px 14px;
    }
    .rss-grid {
        grid-template-columns: 1fr;
    }
    .rss-aggregation {
        padding: 12px 14px;
    }
    .rss-aggregation .rss-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .site-info-module {
        padding: 12px 14px;
    }
    .site-info-module .info-box table td:first-child {
        width: 60px;
        font-size: 0.8rem;
    }
    .site-info-module .info-box table td:last-child {
        font-size: 0.85rem;
    }
    .site-info-module .info-actions {
        flex-direction: column;
    }
    .site-info-module .info-actions button {
        width: 100%;
        justify-content: center;
    }
    .link-form-section input,
    .link-form-section textarea {
        font-size: 0.9rem;
    }
    .link-form-section .captcha-row {
        flex-wrap: wrap;
    }
    .link-form-section .captcha-row input[type="text"] {
        width: 100%;
        max-width: 160px;
    }
}

@media (max-width: 480px) {
    .link-card h3 {
        font-size: 1rem;
    }
    .link-card p {
        font-size: 0.85rem;
    }
    .site-info-module .info-box {
        padding: 8px 10px;
    }
    .site-info-module .info-box table td:first-child {
        width: 50px;
        font-size: 0.75rem;
    }
    .site-info-module .info-box table td:last-child {
        font-size: 0.8rem;
    }
    .rss-item h4 {
        font-size: 0.9rem;
    }
    .link-form-section button[type="submit"] {
        width: 100%;
        padding: 10px;
    }
}

/* ========== 返回顶部按钮 ========== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 0;
    background: #ffffff;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}
.back-to-top:active {
    transform: translateY(0);
}
.back-to-top i {
    line-height: 1;
}

/* 可选：带进度环的版本（更精致） */
.back-to-top.progress {
    background: transparent;
    border: none;
    box-shadow: none;
}
.back-to-top.progress:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}
.back-to-top.progress svg {
    transform: rotate(-90deg);
    width: 44px;
    height: 44px;
}
.back-to-top.progress svg circle {
    fill: none;
    stroke-width: 3;
}
.back-to-top.progress svg .bg {
    stroke: #e8e8e8;
}
.back-to-top.progress svg .progress-ring {
    stroke: #0066cc;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.15s;
}
.back-to-top.progress .arrow-icon {
    position: absolute;
    font-size: 16px;
    color: #333;
    pointer-events: none;
}
.back-to-top.progress:hover .arrow-icon {
    color: #0066cc;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .back-to-top.progress svg {
        width: 40px;
        height: 40px;
    }
    .back-to-top.progress .arrow-icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .back-to-top.progress svg {
        width: 36px;
        height: 36px;
    }
    .back-to-top.progress .arrow-icon {
        font-size: 12px;
    }
}

/* ============================================================
   🌙 深色模式（通过 .dark-mode 类切换）
   追加到 index.css 末尾即可
   ============================================================ */

/* 基础深色覆盖 */
.dark-mode,
.dark-mode body {
    background: #121212;
    color: #e0e0e0;
}

.dark-mode .container {
    background: #1e1e1e;
    box-shadow: none;
}

/* 链接 */
.dark-mode a {
    color: #66b3ff;
}
.dark-mode a:hover {
    color: #99ccff;
}

/* 标题 & 文字 */
.dark-mode .site-title a,
.dark-mode .article-info h3 a,
.dark-mode .container h3 a,
.dark-mode .diary-card h3 a,
.dark-mode .link-card h3 a,
.dark-mode .rank-item a,
.dark-mode .intro-section a:not(.tag-cloud-item) {
    color: #e0e0e0;
}
.dark-mode .site-title a:hover,
.dark-mode .article-info h3 a:hover,
.dark-mode .container h3 a:hover,
.dark-mode .diary-card h3 a:hover,
.dark-mode .link-card h3 a:hover,
.dark-mode .rank-item a:hover {
    color: #66b3ff;
}

/* 边框 & 分隔线 */
.dark-mode #main-nav,
.dark-mode #main-nav .search-wrapper input[type="text"],
.dark-mode hr,
.dark-mode .article-card,
.dark-mode .diary-card,
.dark-mode .link-card,
.dark-mode .stat-card,
.dark-mode .pagination a,
.dark-mode .pagination span,
.dark-mode .tag-cloud a,
.dark-mode .tag-cloud-section,
.dark-mode .blacklist-box,
.dark-mode .site-info-module .info-box,
.dark-mode .rss-item,
.dark-mode .intro-section,
.dark-mode .changelog-item,
.dark-mode .rank-list li,
.dark-mode .back-to-top {
    border-color: #333 !important;
}

/* 导航 */
.dark-mode #main-nav a {
    color: #ccc;
}
.dark-mode #main-nav a:hover {
    color: #66b3ff;
}
.dark-mode #main-nav .search-wrapper input[type="text"] {
    background: #2a2a2a;
    color: #e0e0e0;
}
.dark-mode #main-nav .search-wrapper input[type="text"]:focus {
    border-color: #66b3ff;
}
.dark-mode #main-nav .search-wrapper button {
    background: #66b3ff;
    color: #121212;
}
.dark-mode #main-nav .search-wrapper button:hover {
    background: #99ccff;
}

/* 菜单按钮（移动端） */
.dark-mode .menu-toggle {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
.dark-mode .menu-toggle:hover {
    background: #333;
}

/* 文章卡片 */
.dark-mode .article-info p {
    color: #bbb;
}
.dark-mode .article-info small {
    color: #888;
}
.dark-mode .article-info p .tag {
    background: #333;
    color: #ccc;
}
.dark-mode .article-info p .tag:hover {
    background: #444;
}
.dark-mode .top-badge {
    background: #e65100;
}
.dark-mode .article-thumb {
    background: #2a2a2a;
}
.dark-mode .thumb-loader {
    background: #2a2a2a;
}
.dark-mode .thumb-fallback {
    background: #2a2a2a;
    color: #555;
}
.dark-mode .thumb-spinner {
    border-color: #444;
    border-top-color: #66b3ff;
}

/* 分页 */
.dark-mode .pagination a,
.dark-mode .pagination span {
    background: transparent;
    color: #ccc;
}
.dark-mode .pagination a:hover {
    background: #2a2a2a;
}
.dark-mode .pagination .current {
    background: #66b3ff;
    border-color: #66b3ff;
    color: #121212;
}
.dark-mode .pagination .dots {
    color: #666;
}

/* 页脚 */
.dark-mode .footer {
    color: #888;
}
.dark-mode .footer a {
    color: #66b3ff;
}

/* 返回顶部 */
.dark-mode .back-to-top {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
.dark-mode .back-to-top:hover {
    background: #66b3ff;
    border-color: #66b3ff;
    color: #121212;
}

/* 统计卡片 */
.dark-mode .stat-card {
    background: #262626;
}
.dark-mode .stat-card:hover {
    background: #2e2e2e;
}
.dark-mode .stat-card .number {
    color: #e0e0e0;
}
.dark-mode .stat-card .label {
    color: #888;
}
.dark-mode .stat-card i {
    color: #66b3ff;
}

/* 标签云 */
.dark-mode .tag-cloud a {
    background: #2a2a2a;
    color: #ccc !important;
    border-color: #444;
}
.dark-mode .tag-cloud a:hover {
    background: #3a3a3a;
    border-color: #666;
}
.dark-mode .tag-cloud-section {
    background: #262626;
}
.dark-mode .tag-cloud-item {
    background: rgba(102, 179, 255, 0.15) !important;
    border-color: rgba(102, 179, 255, 0.3) !important;
}

/* 排行榜 */
.dark-mode .rank-num {
    background: #333;
    color: #999;
}
.dark-mode .rank-num.gold {
    background: #b8960f;
    color: #121212;
}
.dark-mode .rank-num.silver {
    background: #888;
    color: #121212;
}
.dark-mode .rank-num.bronze {
    background: #a0622e;
    color: #fff;
}
.dark-mode .rank-count {
    color: #888;
}
.dark-mode .time {
    color: #666;
}

/* 留言板 & 评论区 */
/* 深色旧样式已移除 */

.dark-mode .cm-badge-link {
    background: #1a3a5c;
    color: #66b3ff;
}
.dark-mode .cm-badge-link:hover {
    background: #1a4a6c;
}
.dark-mode .comment-body,
.dark-mode .gb-body {
    color: #ccc;
}


/* emoji 面板 */
.dark-mode .emoji-panel {
    background: #2a2a2a;
    border-color: #444;
}
.dark-mode .emoji-btn:hover {
    background: #3a3a3a;
}
.dark-mode #emoji-toggle:hover {
    background: #3a3a3a;
    color: #66b3ff;
}

/* 友链 */
.dark-mode .link-card {
    background: #262626;
}
.dark-mode .link-card:hover {
    background: #2e2e2e;
}
.dark-mode .link-tag {
    background: #333;
    color: #aaa;
}
.dark-mode .link-url {
    color: #888;
}

/* RSS 聚合 */
.dark-mode .rss-aggregation {
    background: #1a2a1a;
    border-color: #2a4a2a !important;
}
.dark-mode .rss-aggregation .rss-header h3 {
    color: #66cc88;
}
.dark-mode .rss-aggregation .rss-header a {
    color: #66cc88;
}
.dark-mode .rss-item {
    background: #1e2e1e;
    border-color: #2a3a2a;
}
.dark-mode .rss-item:hover {
    border-color: #3a5a3a;
}
.dark-mode .rss-item .rss-site a {
    color: #66cc88;
}
.dark-mode .rss-item h4 a {
    color: #ccc;
}
.dark-mode .rss-item h4 a:hover {
    color: #66b3ff;
}
.dark-mode .rss-empty {
    background: #1a2a1a;
    border-color: #2a4a2a !important;
}
.dark-mode .rss-empty p {
    color: #66cc88;
}

/* 本站信息模块 */
.dark-mode .site-info-module {
    background: #1a2a3a;
    border-color: #2a4a6a !important;
}
.dark-mode .site-info-module h3 {
    color: #66b3ff;
}
.dark-mode .site-info-module .info-box {
    background: #1e2e3e;
    border-color: #2a4a6a !important;
}
.dark-mode .site-info-module .info-box table td:first-child {
    color: #888;
}
.dark-mode .site-info-module .info-box table td:last-child {
    color: #ccc;
}
.dark-mode .site-info-module .info-box table td:last-child a {
    color: #66b3ff;
}
.dark-mode .site-info-module .info-actions button {
    background: #2a6a3a;
    color: #e0e0e0;
}
.dark-mode .site-info-module .info-actions button:hover {
    background: #3a8a4a;
}

/* 关于页面 */
.dark-mode .info-box {
    background: #262626;
}
.dark-mode .intro-section p,
.dark-mode .intro-section ul li {
    color: #bbb;
}
.dark-mode .intro-section ul li strong {
    color: #e0e0e0;
}
.dark-mode .intro-section h3 {
    color: #e0e0e0;
}
.dark-mode .intro-section h3 i {
    color: #66b3ff;
}

/* 更新日志 */
.dark-mode .changelog-dot {
    background: #66b3ff;
}
.dark-mode .changelog-version {
    color: #e0e0e0;
}
.dark-mode .changelog-version:hover {
    color: #66b3ff;
}
.dark-mode .changelog-date {
    color: #888;
}
.dark-mode .changelog-list li {
    color: #bbb;
}
.dark-mode .changelog-list li::before {
    color: #66b3ff;
}

/* 小黑屋 */
.dark-mode .blacklist-box {
    background: #0a0a0a;
    border-color: #2a2a2a !important;
}
.dark-mode .blacklist-box .blocked-ip {
    background: #1a1a1a;
    border-color: #333;
    color: #ff6666;
}

/* 搜索建议 */
.dark-mode .search-suggestions {
    background: #2a2a2a;
    border-color: #444;
}
.dark-mode .search-suggestions a {
    color: #ccc;
    border-color: #333;
}
.dark-mode .search-suggestions a:hover,
.dark-mode .search-suggestions a.active {
    background: #333;
}
.dark-mode .suggestion-excerpt {
    color: #888;
}
.dark-mode .suggestion-date {
    color: #666;
}
.dark-mode .no-result {
    color: #888;
}

/* 轮播 */
.dark-mode .carousel-container {
    background: var(--bg-card);
    border-color: var(--border);
}
.dark-mode .carousel-desc {
    color: var(--text-secondary);
}
.dark-mode .carousel-stats {
    color: var(--text-hint);
}
.dark-mode .carousel-dot {
    background: var(--border);
}
.dark-mode .carousel-dot.active {
    background: var(--primary);
}
.dark-mode .carousel-arrow {
    background: rgba(30,30,30,0.9);
    border-color: var(--border);
    color: var(--text-secondary);
}
.dark-mode .carousel-arrow:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}


/* 文章正文（Markdown 渲染） */
.dark-mode .article-content blockquote {
    background: #262626;
    border-color: #66b3ff;
    color: #ccc;
}
.dark-mode .article-content code {
    background: #2a2a2a;
    color: #ff79c6;
    border-color: #444;
}
.dark-mode .article-content pre {
    background: #1a1a1a;
    border-color: #444;
}
.dark-mode .article-content pre code {
    color: #e0e0e0;
}
.dark-mode .article-content th,
.dark-mode .article-content td {
    border-color: #444;
}
.dark-mode .article-content th {
    background: #262626;
}
.dark-mode .article-content tr:nth-child(even) {
    background: #222;
}
.dark-mode .article-content hr {
    border-color: #333;
}

/* 文章目录 */
.dark-mode .article-toc {
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
}
.dark-mode .toc-summary { color: var(--text); }
.dark-mode .toc-count { background: rgba(255,255,255,0.08); border-color: var(--border); }
.dark-mode .toc-link { color: var(--text-secondary); }
.dark-mode .toc-link:hover { background: rgba(255,255,255,0.08); color: var(--primary); }
.dark-mode .toc-link.active { background: var(--primary); color: #fff; }


/* 分享按钮 */
.dark-mode .share-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
.dark-mode .share-btn:hover {
    background: #3a3a3a;
}
.dark-mode .share-weibo { border-color: #e6162d; color: #e6162d; }
.dark-mode .share-weibo:hover { background: #e6162d; color: #fff; }
.dark-mode .share-qq { border-color: #12b7f5; color: #12b7f5; }
.dark-mode .share-qq:hover { background: #12b7f5; color: #fff; }
.dark-mode .share-twitter { border-color: #1da1f2; color: #1da1f2; }
.dark-mode .share-twitter:hover { background: #1da1f2; color: #fff; }
.dark-mode .share-facebook { border-color: #1877f2; color: #1877f2; }
.dark-mode .share-facebook:hover { background: #1877f2; color: #fff; }
.dark-mode .share-wechat { border-color: #07c160; color: #07c160; }
.dark-mode .share-wechat:hover { background: #07c160; color: #fff; }
.dark-mode .share-copy { border-color: #666; color: #999; }
.dark-mode .share-copy:hover { background: #666; color: #fff; }

/* 微信弹窗 */
.dark-mode #wechat-modal .modal-box {
    background: #2a2a2a;
}
.dark-mode #wechat-modal .modal-close {
    color: #888;
}
.dark-mode #wechat-modal .modal-close:hover {
    color: #ccc;
}
.dark-mode #wechat-modal .modal-title {
    color: #e0e0e0;
}

/* 文章导航 */
.dark-mode .article-nav a {
    color: #ccc;
}
.dark-mode .article-nav a:hover {
    color: #66b3ff;
}
.dark-mode .nav-label {
    color: #888;
}

/* 相关文章 */
.dark-mode .related-list a {
    color: #ccc;
}
.dark-mode .related-list a:hover {
    color: #66b3ff;
}
.dark-mode .related-list a i {
    color: #666;
}

/* 消息提示 */
.dark-mode .message {
    background: #262626;
    border-color: #66b3ff;
    color: #ccc;
}
.dark-mode .error-msg {
    background: #2a1a1a;
    border-color: #d32f2f;
    color: #ff6b6b;
}

/* 表单标签 */
.dark-mode .link-form-section label,
.dark-mode #comment-form label {
    color: #ccc;
}
.dark-mode .link-form-section .note {
    color: #888;
}
.dark-mode .link-form-section .captcha-row span {
    color: #888;
}

/* ===== 深色模式切换按钮（可选项） ===== */
.dark-mode-toggle {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 998;
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.dark-mode .dark-mode-toggle {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
.dark-mode .dark-mode-toggle:hover {
    background: #3a3a3a;
}
.dark-mode-toggle:hover {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

@media (max-width: 768px) {
    .dark-mode-toggle {
        bottom: 70px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
}
/* ========== 首页数据概览 ========== */
.home-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.stat-card {
    text-align: center;
    padding: var(--space-sm) var(--space-xs);
    border-radius: var(--radius-md);
    transition: background 0.15s;
}
.stat-card:hover { background: var(--bg-hover); }
.stat-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--space-xs) auto;
    color: #fff; font-size: 1rem; opacity: 0.9;
}
.stat-num { font-size: 1.3rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 2px; }
@media (max-width: 768px) {
    .home-stats { grid-template-columns: repeat(3, 1fr); gap: var(--space-xs); }
    .stat-num { font-size: 1.1rem; }
    .stat-icon { width: 30px; height: 30px; font-size: 0.85rem; }
}

/* ========== 首页热门文章 & 最新评论 ========== */
.home-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}
.home-widget {
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-light);
}
.home-widget h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 1.05rem; color: var(--text);
    display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.home-widget h3 i { color: var(--primary); font-size: 0.95rem; }
.hot-article-list, .recent-comment-list { list-style: none; padding: 0; margin: 0; }
.hot-article-item, .recent-comment-item {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}
.hot-article-item:last-child, .recent-comment-item:last-child { border-bottom: none; }
.hot-article-item a {
    color: var(--text); text-decoration: none; font-size: var(--font-size-base);
    display: block; transition: color 0.15s;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hot-article-item a:hover { color: var(--primary); }
.hot-article-meta {
    font-size: var(--font-size-sm); color: var(--text-hint);
    margin-top: 4px; display: flex; gap: var(--space-sm);
}
.recent-comment-item { padding-left: 0; }
/* 头像已移除 */
.comment-body { min-width: 0; }
.comment-author { font-size: var(--font-size-sm); font-weight: 600; color: var(--text); }
.comment-content {
    font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.comment-article { font-size: 0.7rem; color: var(--text-hint); margin-top: 2px; }
.comment-article a { color: var(--primary); text-decoration: none; }
@media (max-width: 600px) { .home-widgets { grid-template-columns: 1fr; } }

/* ========== 首页标签云 ========== */
.home-tag-cloud {
    padding: var(--space-lg) 0;
    margin: var(--space-lg) 0;
    border-top: 1px solid var(--border-light);
}
.home-tag-cloud h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 1.05rem; color: var(--text);
    display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.home-tag-cloud h3 i { color: var(--primary); font-size: 0.95rem; }
.tag-cloud-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud-tags a {
    display: inline-block; padding: 3px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover); color: var(--text-secondary);
    text-decoration: none; font-size: var(--font-size-sm);
    transition: all 0.15s;
}
.tag-cloud-tags a:hover { background: var(--primary); color: #fff; }

/* ========== 首页新模块深色模式适配 ========== */
.dark-mode .stat-card:hover { background: rgba(255,255,255,0.05); }
.dark-mode .stat-num { color: var(--text); }
.dark-mode .stat-label { color: var(--text-secondary); }
.dark-mode .home-widget h3, .dark-mode .home-tag-cloud h3 { color: var(--text); }
.dark-mode .hot-article-item a { color: var(--text); }
.dark-mode .hot-article-item a:hover { color: var(--primary); }
.dark-mode .hot-article-meta, .dark-mode .comment-content, .dark-mode .comment-article { color: var(--text-hint); }
.dark-mode .comment-author { color: var(--text); }
.dark-mode .tag-cloud-tags a { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.dark-mode .tag-cloud-tags a:hover { background: var(--primary); color: #fff; }


/* ========== 面包屑导航 ========== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-hint);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.breadcrumb a:hover {
    color: var(--primary);
}
.breadcrumb-sep {
    font-size: 0.6rem;
    opacity: 0.5;
}
.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.dark-mode .breadcrumb a { color: var(--text-secondary); }
.dark-mode .breadcrumb a:hover { color: var(--primary); }
.dark-mode .breadcrumb-current { color: var(--text); }


/* ========== 评论组件优化 ========== */
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}
.comment-count {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}
.comment-count i {
    color: var(--primary);
    margin-right: 6px;
}

/* 评论列表 */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-list-nested {
    padding-left: 24px;
    margin-top: 12px;
    border-left: 2px solid var(--border-light);
}
.comment-item {
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px dotted var(--border);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-author {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}
.comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.comment-badge-admin {
    background: var(--primary);
    color: #fff;
}
.comment-badge-link {
    background: var(--bg-hover);
    color: var(--primary);
    text-decoration: none;
    transition: all 0.15s;
}
.comment-badge-link:hover {
    background: var(--primary-light);
    text-decoration: none;
}
.comment-time {
    font-size: 0.75rem;
    color: var(--text-hint);
}
.comment-time i {
    margin-right: 4px;
}
.comment-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    word-break: break-word;
    margin: 4px 0;
}
/* comment-actions 已移除 */
.comment-actions .reply-btn {
    font-size: 0.8rem;
    color: var(--text-hint);
    text-decoration: none;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.comment-actions .reply-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    text-decoration: none;
}
.comment-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-hint);
    font-size: 0.95rem;
}
.comment-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* 评论表单 */
.comment-form-wrapper {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}
.comment-form-row {
    margin-bottom: 14px;
}
.comment-form-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.comment-form-row label i {
    color: var(--primary);
    margin-right: 4px;
}
.comment-form-row .required {
    color: #ef4444;
    margin-left: 2px;
}
.comment-form-row input[type="text"],
.comment-form-row input[type="email"],
.comment-form-row input[type="url"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.comment-form-row input:focus {
    outline: none;
    border-color: var(--primary);
}
.comment-textarea-wrapper {
    position: relative;
}
.comment-textarea-wrapper textarea {
    width: 100%;
    padding: 10px 12px 40px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.comment-textarea-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.comment-textarea-wrapper #emoji-toggle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-hint);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.comment-textarea-wrapper #emoji-toggle:hover {
    background: var(--bg-hover);
    color: var(--primary);
}
.comment-captcha {
    display: flex;
    align-items: center;
    gap: 10px;
}
.comment-captcha input {
    flex: 1;
    max-width: 200px;
}
.comment-captcha-img {
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
}
.comment-remember {
    margin-bottom: 16px;
}
.comment-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.comment-submit-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.comment-submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.comment-submit-btn:active {
    transform: translateY(0);
}

/* 表情面板 */
.emoji-panel {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    margin: 8px 0;
    flex-wrap: wrap;
    gap: 4px;
    box-shadow: var(--shadow-sm);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
}
.emoji-panel-show {
    display: flex !important;
}
.emoji-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: all 0.15s;
}
.emoji-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.2);
}

/* 深色模式 */
.dark-mode .comment-form-wrapper {
    background: var(--bg-card);
    border-color: var(--border);
}
.dark-mode .comment-form-row input,
.dark-mode .comment-textarea-wrapper textarea {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}
.dark-mode .comment-submit-btn {
    background: var(--primary);
}
.dark-mode .comment-submit-btn:hover {
    background: var(--primary-hover);
}
.dark-mode .emoji-panel {
    background: var(--bg-card);
    border-color: var(--border);
}
.dark-mode .comment-badge-link {
    background: rgba(255,255,255,0.08);
}
.dark-mode .comment-badge-link:hover {
    background: rgba(255,255,255,0.12);
}

/* 响应式 */
@media (max-width: 600px) {
    .comment-list-nested {
        padding-left: 16px;
    }
    .comment-form-wrapper {
        padding: 14px;
    }
    .comment-captcha {
        flex-direction: column;
        align-items: flex-start;
    }
}
