/**
 * 澄曜 - Emlog 主题 CSS
 * 完美移植自 Inaline Typecho 主题
 * @author 澄曜
 */

/* ==================== CSS 变量 ==================== */
:root {
    --primary-color: #FF7900;
    --primary-color-light: #FF9A40;
    --primary-color-dark: #E66A00;
    --bg-color: #FFFFFF;
    --page-bg-color: #F5F5F5;
    --text-color: #333333;
    --text-color-light: #666666;
    --border-color: #E0E0E0;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --topbar-height: 52px;
    --categories-height: 36px;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --card-padding: 13.14px;
    --content-max-width: 1200px;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --page-bg-color: #0d0d0d;
    --text-color: #e0e0e0;
    --text-color-light: #b0b0b0;
    --border-color: #333333;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.6);
}

/* ==================== 全局重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { outline: none; text-decoration: none; }
a:focus { outline: none; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    background-color: var(--page-bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

body.overflow-hidden { overflow: hidden; }

/* ==================== Main 内容区 ==================== */
main {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 16px;
    padding-top: calc(var(--topbar-height) + var(--categories-height) + 16px);
}
.main-container { width: 100%; }
.content-wrapper {
    display: flex;
    gap: 24px;
    width: 100%;
}
.content-column {
    flex: 1;
    min-width: 0;
}
.sidebar-column {
    width: 320px;
    flex-shrink: 0;
}

/* ==================== 卡片 ==================== */
.card {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xs);
    padding: var(--card-padding);
    margin-bottom: 16px;
    transition: box-shadow var(--transition-speed), background-color var(--transition-speed);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}
.card-content {
    font-size: 14px;
    color: var(--text-color-light);
    line-height: 1.6;
}

/* ==================== TopBar ==================== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(var(--topbar-height) + var(--categories-height));
    background-color: var(--bg-color);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: background-color var(--transition-speed);
}
.topbar-container {
    display: flex;
    align-items: center;
    height: var(--topbar-height);
    padding: 0 16px;
    max-width: var(--content-max-width);
    margin: 0 auto;
}
.topbar-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.05);
    width: 100%;
}
body.dark-mode .topbar-divider { background-color: rgba(255, 255, 255, 0.05); }

/* TopBar 按钮 */
.topbar-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: none; background: transparent;
    cursor: pointer;
    color: var(--text-color);
    font-size: 20px;
    border-radius: 50%;
    transition: all var(--transition-speed);
}
/* 桌面端隐藏汉堡菜单按钮 */
#menuBtn { display: none; }
.topbar-btn:hover {
    color: var(--primary-color);
    background-color: rgba(255, 121, 0, 0.1);
}

/* Logo */
.topbar-logo {
    display: flex; align-items: center;
    margin-right: 25px; margin-left: 10px;
    text-decoration: none;
}
.topbar-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

/* 桌面导航 */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-nav-item {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}
.topbar-nav-item:hover {
    color: var(--primary-color);
    background-color: rgba(255, 121, 0, 0.05);
}
.topbar-nav-item.active {
    color: var(--primary-color);
    background-color: rgba(255, 121, 0, 0.08);
}
.topbar-nav-icon { font-size: 16px; }
.topbar-actions {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto;
}

/* ==================== 分类栏 ==================== */
.categories-container {
    display: flex;
    align-items: center;
    height: var(--categories-height);
    padding: 0 16px;
    max-width: var(--content-max-width);
    margin: 0 auto;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.categories-container::-webkit-scrollbar { display: none; }
.category-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    text-decoration: none;
    color: var(--text-color-light);
    font-size: 13px;
    border-radius: 16px;
    transition: all var(--transition-speed);
    white-space: nowrap;
    flex-shrink: 0;
}
.category-item:hover {
    color: var(--primary-color);
    background-color: rgba(255, 121, 0, 0.05);
}
.category-item.active {
    color: var(--primary-color);
    background-color: rgba(255, 121, 0, 0.1);
    font-weight: 500;
}
.category-icon { font-size: 14px; }
.category-icon-img { width: auto; height: 1em; max-height: 14px; vertical-align: middle; margin-right: 4px; }
.sidebar-icon-img { width: auto; height: 1em; max-height: 14px; vertical-align: middle; margin-right: 6px; }

/* ==================== 搜索面板 ==================== */
.topbar-search {
    position: fixed;
    top: calc(var(--topbar-height) + var(--categories-height));
    left: 0; right: 0;
    z-index: 1001;
    display: none;
    background: var(--bg-color);
    box-shadow: var(--shadow-md);
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}
.topbar-search.show { display: block; }
.search-card {
    max-width: 600px;
    margin: 0 auto;
}
.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--page-bg-color);
    border-radius: 24px;
    padding: 8px 16px;
    gap: 8px;
    border: 2px solid transparent;
    transition: border-color var(--transition-speed);
}
.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
}
.search-icon { color: var(--text-color-light); font-size: 20px; }
.search-input {
    flex: 1;
    border: none; outline: none; background: transparent;
    font-size: 15px;
    color: var(--text-color);
}
.search-submit {
    padding: 6px 20px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition-speed);
}
.search-submit:hover { background: var(--primary-color-dark); }
.search-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0 8px;
}
.search-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color-light);
}
.search-hot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.search-hot-item {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border-radius: 16px;
    background: var(--page-bg-color);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    transition: all var(--transition-speed);
}
.search-hot-item:hover {
    background: rgba(255, 121, 0, 0.1);
    color: var(--primary-color);
}
.search-hot-rank {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color-light);
    min-width: 16px;
    text-align: center;
}
.search-hot-rank.hot-rank-1 { color: #e74c3c; }
.search-hot-rank.hot-rank-2 { color: #e67e22; }
.search-hot-rank.hot-rank-3 { color: #f39c12; }
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 999;
}
.search-overlay.show { display: block; }

/* ==================== 侧边栏（抽屉） ==================== */
.sidebar {
    position: fixed;
    top: 0; left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-color);
    box-shadow: var(--shadow-lg);
    z-index: 1002;
    transition: left var(--transition-speed);
    display: flex;
    flex-direction: column;
}
.sidebar.show { left: 0; }
.sidebar-content {
    flex: 1;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.sidebar-user {
    padding: 24px 20px 16px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
    gap: 8px;
}
.sidebar-user-status {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    color: #fff;
    font-weight: 500;
}
.sidebar-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-avatar-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}
.sidebar-user-name { font-size: 16px; font-weight: 600; color: var(--text-color); }
.sidebar-user-bio { font-size: 12px; color: var(--text-color-light); }
.sidebar-stats { display: flex; gap: 24px; margin-top: 8px; }
.sidebar-stat-item { text-align: center; min-width: 40px; }
.sidebar-stat-value { font-size: 18px; font-weight: 700; color: var(--text-color); }
.sidebar-stat-label { font-size: 11px; color: var(--text-color-light); }

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin: 0 16px;
}
.sidebar-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-speed);
}
.sidebar-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.sidebar-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}
.sidebar-tab-pane { display: none; }
.sidebar-tab-pane.active { display: flex; flex-direction: column; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    border-radius: 6px;
    transition: all var(--transition-speed);
}
.sidebar-link:hover {
    color: var(--primary-color);
    background: rgba(255, 121, 0, 0.05);
}
.sidebar-link.active {
    color: var(--primary-color);
    background: rgba(255, 121, 0, 0.1);
    font-weight: 500;
}
.sidebar-link .mdi { font-size: 18px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 1001;
}
.sidebar-overlay.show { display: block; }

/* ==================== 轮播图 ==================== */
.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    background-color: var(--border-color);
}
.carousel-inner {
    position: relative;
    width: 100%;
    padding-bottom: 40%;
}
.carousel-item {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}
.carousel-item.active { opacity: 1; visibility: visible; }
.carousel-link { display: block; width: 100%; height: 100%; text-decoration: none; }
.carousel-image {
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.carousel-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
}
.carousel-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}
.carousel-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-speed);
    z-index: 10;
    opacity: 0; visibility: hidden;
}
.carousel:hover .carousel-control { opacity: 1; visibility: visible; }
.carousel-control:hover { background: rgba(0, 0, 0, 0.5); }
.carousel-control-prev { left: 12px; }
.carousel-control-next { right: 12px; }
.carousel-indicators {
    position: absolute;
    bottom: 16px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 8px;
    z-index: 10;
}
.carousel-indicator {
    width: 10px; height: 10px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--transition-speed);
    padding: 0;
}
.carousel-indicator.active {
    background: white;
    width: 24px;
    border-radius: 5px;
}

/* ==================== 文章列表标签和布局切换 ==================== */
.article-list-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--card-padding) 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}
.article-list-tabs-left {
    display: flex;
    gap: 4px;
}
.article-list-tab {
    padding: 6px 16px;
    text-decoration: none;
    color: var(--text-color-light);
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    transition: all var(--transition-speed);
    position: relative;
}
.article-list-tab:hover { color: var(--primary-color); }
.article-list-tab.active {
    color: #fff;
    background: var(--primary-color);
}
.article-list-tabs-right {
    display: flex;
    gap: 4px;
}
.article-list-layout-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: transparent;
    color: var(--text-color-light);
    text-decoration: none;
    transition: all var(--transition-speed);
}
.article-list-layout-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.article-list-layout-btn.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: rgba(255, 121, 0, 0.1);
}
.article-list-layout-btn .mdi { font-size: 18px; }

/* ==================== 列表视图文章项 ==================== */
.article-item-link {
    display: flex;
    padding: 16px var(--card-padding);
    text-decoration: none;
    color: var(--text-color);
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed);
}
.article-item-link:last-child { border-bottom: none; }
.article-item-link:hover { background-color: rgba(255, 121, 0, 0.03); }
.article-item-thumbnail {
    flex-shrink: 0;
    width: 160px; height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--border-color);
}
.article-item-thumbnail img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.article-item-content {
    flex: 1;
    display: flex; flex-direction: column;
    min-width: 0;
}
.article-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    line-height: 1.4;
}
.article-item-excerpt {
    font-size: 14px;
    color: var(--text-color-light);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-item-meta {
    display: flex; align-items: center; gap: 16px;
    font-size: 12px;
    color: var(--text-color-light);
    margin-top: auto;
}
.article-item-date,
.article-item-views,
.article-item-comments {
    display: flex; align-items: center; gap: 4px;
}
.article-item-date .mdi,
.article-item-views .mdi,
.article-item-comments .mdi { font-size: 14px; }

/* ==================== 卡片视图文章 ==================== */
.article-list-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: var(--card-padding);
}
.article-card {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-speed), transform var(--transition-speed);
}
.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}
.article-card-link {
    display: block;
    text-decoration: none;
    color: var(--text-color);
}
.article-card-thumbnail {
    width: 100%; height: 180px;
    overflow: hidden;
    background-color: var(--border-color);
}
.article-card-thumbnail img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}
.article-card:hover .article-card-thumbnail img {
    transform: scale(1.05);
}
.article-card-content { padding: 16px; }
.article-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-excerpt {
    font-size: 14px;
    color: var(--text-color-light);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-meta {
    display: flex; align-items: center; gap: 12px;
    font-size: 12px;
    color: var(--text-color-light);
    margin-top: auto;
}
.article-card-date,
.article-card-views,
.article-card-comments {
    display: flex; align-items: center; gap: 4px;
}
.article-card-date .mdi,
.article-card-views .mdi,
.article-card-comments .mdi { font-size: 14px; }

/* 空状态 */
.article-list-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-color-light);
}
.article-list-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.article-list-empty-text { font-size: 16px; }

/* ==================== 分页 ==================== */
.article-list-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px var(--card-padding);
    border-top: 1px solid var(--border-color);
}
.pagination-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 13px;
    text-decoration: none;
    transition: all var(--transition-speed);
}
.pagination-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.pagination-pages { display: flex; gap: 4px; }
.pagination-page {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 14px;
    text-decoration: none;
    transition: all var(--transition-speed);
}
.pagination-page:hover {
    background: rgba(255, 121, 0, 0.08);
    color: var(--primary-color);
}
.pagination-page.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}
.pagination-ellipsis {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    color: var(--text-color-light);
}

/* ==================== 文章详情页 Hero 头部 ==================== */
.article-header {
    position: relative;
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}
.article-header-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(2px);
    transform: scale(1.1);
}
.article-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.3));
}
.article-header-content {
    position: relative;
    width: 100%;
    padding: 48px 24px 16px;
    z-index: 1;
}
.article-header-inner {
    max-width: 800px;
}
.article-header-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
}
.article-header-categories {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.article-header-category {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 13px;
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--transition-speed);
}
.article-header-category:hover {
    background: rgba(255, 255, 255, 0.35);
}
.article-header-info {
    display: flex; align-items: center; gap: 20px;
}
.article-header-info-item {
    display: flex; align-items: center; gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}
.article-header-info-item .mdi { font-size: 18px; }
.article-header-wave {
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    z-index: 2;
    overflow: hidden;
}
.waves-svg {
    position: relative;
    width: 100%; height: 50px;
}
.parallax use {
    animation: waveMove 25s cubic-bezier(.55, .5, .45, .5) infinite;
}
.parallax use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; fill: var(--page-bg-color); opacity: 0.7; }
.parallax use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; fill: var(--page-bg-color); opacity: 0.5; }
.parallax use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; fill: var(--page-bg-color); opacity: 0.3; }
.parallax use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; fill: var(--page-bg-color); }

@keyframes waveMove {
    0% { transform: translate3d(-90px, 0, 0); }
    100% { transform: translate3d(85px, 0, 0); }
}

/* ==================== Markdown 文章内容 ==================== */
.article-content-card {
    padding: 24px;
}
.markdown-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    word-wrap: break-word;
}
.markdown-content h1 { font-size: 1.8em; margin: 1.2em 0 0.6em; border-bottom: 2px solid var(--border-color); padding-bottom: 0.3em; }
.markdown-content h2 { font-size: 1.5em; margin: 1em 0 0.5em; }
.markdown-content h3 { font-size: 1.25em; margin: 0.8em 0 0.4em; }
.markdown-content h4, .markdown-content h5, .markdown-content h6 { margin: 0.6em 0 0.3em; }
.markdown-content p { margin-bottom: 1em; }
.markdown-content img { max-width: 100%; border-radius: var(--border-radius); }
.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 8px 16px;
    margin: 1em 0;
    background: var(--page-bg-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    color: var(--text-color-light);
}
.markdown-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1em 0;
    font-size: 14px;
    line-height: 1.5;
}
body.dark-mode .markdown-content pre { background: #1e1e1e; }
.markdown-content code {
    background: var(--page-bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-color);
}
.markdown-content pre code { background: none; padding: 0; color: inherit; }
.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.markdown-content th, .markdown-content td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}
.markdown-content th {
    background: var(--page-bg-color);
    font-weight: 600;
}
.markdown-content ul, .markdown-content ol { padding-left: 2em; margin-bottom: 1em; }
.markdown-content li { margin-bottom: 0.3em; }
.markdown-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.markdown-content a:hover { color: var(--primary-color-dark); }

/* 文章标签 */
.article-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
.article-tag {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 12px;
    background: rgba(255, 121, 0, 0.08);
    color: var(--primary-color);
    font-size: 13px;
    border-radius: 16px;
    text-decoration: none;
    transition: all var(--transition-speed);
}
.article-tag:hover { background: rgba(255, 121, 0, 0.2); }

/* 上一篇/下一篇 */
.article-nav { padding: 16px var(--card-padding); }
.article-nav-row {
    display: flex;
    gap: 12px;
}
.article-nav-item {
    flex: 1;
    display: flex; align-items: center; gap: 8px;
    padding: 12px;
    border-radius: var(--border-radius);
    background: var(--page-bg-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-speed);
}
.article-nav-item:hover { background: rgba(255, 121, 0, 0.05); color: var(--primary-color); }
.article-nav-prev { text-align: left; }
.article-nav-next { text-align: right; justify-content: flex-end; }
.article-nav-text { min-width: 0; }
.article-nav-label { font-size: 12px; color: var(--text-color-light); display: block; }
.article-nav-title {
    font-size: 14px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* ==================== 侧边栏：用户卡片 ==================== */
.user-card .card-content { padding: 12px; }
.user-info-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-avatar {
    width: 56px; height: 56px; flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    color: white;
    font-size: 24px;
    font-weight: 600;
}
.user-info-text { flex: 1; min-width: 0; }
.user-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.user-name { font-size: 15px; font-weight: 600; color: var(--text-color); }
.user-status-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    flex-shrink: 0;
}
.user-bio { font-size: 12px; color: var(--text-color-light); line-height: 1.4; }
.user-bottom-row {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.user-stats { display: flex; gap: 16px; }
.user-stat-item { text-align: center; min-width: 40px; }
.user-stat-value { font-size: 16px; font-weight: 600; color: var(--text-color); line-height: 1; }
.user-stat-label { font-size: 10px; color: var(--text-color-light); }
.user-contacts { display: flex; gap: 8px; }
.user-contact-item {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 6px;
    background-color: var(--page-bg-color);
    color: var(--text-color-light);
    font-size: 16px;
    transition: all var(--transition-speed);
    text-decoration: none;
}
.user-contact-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ==================== 侧边栏：热门文章 ==================== */
.hot-articles-card .card-content { padding: 12px; }
.hot-articles-card .article-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 12px;
}
.hot-articles-card .article-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--page-bg-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.hot-articles-card .article-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.hot-articles-card .article-link {
    display: flex;
    text-decoration: none;
    color: var(--text-color);
    align-items: center;
}
.hot-articles-card .article-thumbnail {
    width: 80px; height: 60px; flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
}
.hot-articles-card .article-thumbnail img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.hot-articles-card .article-info {
    flex: 1; padding: 8px 12px;
    display: flex; flex-direction: column; justify-content: center;
    min-width: 0;
}
.hot-articles-card .article-title {
    font-size: 13px; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
    color: var(--text-color);
}
.hot-articles-card .article-meta {
    display: flex; align-items: center; gap: 12px;
    font-size: 11px; color: var(--text-color-light);
}
.hot-articles-card .article-meta span {
    display: flex; align-items: center; gap: 4px;
}

/* ==================== 侧边栏：最新评论 ==================== */
.recent-comments-card .card-content { padding: 12px; }
.recent-comments-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 12px;
}
.recent-comments-item {
    display: flex; gap: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}
.recent-comments-item:last-child { padding-bottom: 0; border-bottom: none; }
.recent-comments-avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
}
.recent-comments-avatar img,
.recent-comments-avatar .avatar-default {
    width: 100%; height: 100%; object-fit: cover;
}
.recent-comments-content { flex: 1; min-width: 0; }
.recent-comments-header {
    display: flex; align-items: center; justify-content: space-between;
}
.recent-comments-author {
    font-size: 13px; font-weight: 500; color: var(--text-color);
}
.recent-comments-date { font-size: 11px; color: var(--text-color-light); }
.recent-comments-text {
    font-size: 12px; color: var(--text-color-light);
    line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ==================== 随机一言 ==================== */
.random-word-container {
    position: relative;
    background-color: var(--page-bg-color);
    border-radius: 12px;
    padding: 24px;
    min-height: 100px;
    display: flex; align-items: center; justify-content: center;
}
.quote-icon {
    position: absolute;
    width: 24px; height: 24px;
    opacity: 0.6;
    color: var(--text-color-light);
}
.quote-open { top: 8px; left: 8px; }
.quote-close { bottom: 8px; right: 8px; }
.random-word-text {
    position: relative;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    text-align: center;
    padding: 0 24px;
}

/* ==================== Footer ==================== */
.footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 16px;
    transition: background-color var(--transition-speed);
}
.footer-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 16px;
}
.footer-main {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.footer-info {
    display: flex; flex-wrap: wrap; gap: 16px;
    flex: 1;
}
.footer-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-color-light);
}
.footer-icon { font-size: 16px; color: var(--primary-color); }
.footer-text { color: var(--text-color-light); }
.footer-link {
    color: var(--text-color-light);
    text-decoration: none;
    transition: color var(--transition-speed);
}
.footer-link:hover { color: var(--primary-color); }
.footer-links { display: flex; gap: 12px; flex-shrink: 0; }
.footer-link-item {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 6px;
    background-color: var(--page-bg-color);
    color: var(--text-color-light);
    font-size: 18px;
    transition: all var(--transition-speed);
    text-decoration: none;
}
.footer-link-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ==================== 评论样式 ==================== */
.cm-section { margin-top: 8px; }
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-item {
    display: flex; gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.cm-item:last-child { border-bottom: none; }
.cm-item .cm-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--page-bg-color);
}
.cm-body { flex: 1; min-width: 0; }
.cm-meta {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 4px;
}
.cm-name { font-size: 14px; font-weight: 600; color: var(--text-color); }
.cm-time { font-size: 12px; color: var(--text-color-light); }
.cm-text {
    font-size: 14px; line-height: 1.6;
    color: var(--text-color);
    word-break: break-word;
}
.cm-text p { margin-bottom: 0.5em; }
.cm-reply { margin-top: 6px; }
.cm-reply-btn {
    background: none; border: none;
    color: var(--primary-color);
    font-size: 12px; cursor: pointer; padding: 2px 8px;
    border-radius: 4px;
    transition: background var(--transition-speed);
}
.cm-reply-btn:hover { background: rgba(255,121,0,0.1); }
.cm-children {
    list-style: none;
    margin: 12px 0 0 20px;
    padding: 0;
    border-left: 2px solid var(--primary-color-light);
    padding-left: 16px;
}
.cm-child { border-bottom: 1px solid var(--border-color); }
.cm-child:last-child { border-bottom: none; }
.cm-empty {
    text-align: center; padding: 40px 0;
    color: var(--text-color-light);
    font-size: 14px;
}
.cm-pages { margin-top: 16px; text-align: center; }
.cm-pages a, .cm-pages span {
    display: inline-block; padding: 4px 10px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 13px; color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-speed);
}
.cm-pages a:hover { background: rgba(255,121,0,0.1); color: var(--primary-color); }
.cm-pages .current { background: var(--primary-color); color: #fff; }

/* 评论表单 */
.cm-form-wrap { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.cm-form { display: flex; flex-direction: column; gap: 10px; }
.cm-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--page-bg-color);
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color var(--transition-speed);
}
.cm-textarea:focus { outline: none; border-color: var(--primary-color); }
.cm-fields { display: flex; gap: 10px; }
.cm-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--page-bg-color);
    color: var(--text-color);
    font-size: 14px;
    transition: border-color var(--transition-speed);
}
.cm-input:focus { outline: none; border-color: var(--primary-color); }
.cm-actions {
    display: flex; align-items: center; gap: 10px;
}
.cm-submit {
    padding: 10px 24px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--border-radius);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-speed);
}
.cm-submit:hover { background: var(--primary-color-dark); }
.cm-cancel {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color-light);
    border-radius: var(--border-radius);
    font-size: 13px;
    cursor: pointer;
}
.cm-cancel:hover { border-color: var(--primary-color); color: var(--primary-color); }
.cm-login-tip { font-size: 13px; color: var(--text-color-light); }
.cm-captcha { margin: 4px 0; }

@media (max-width: 767px) {
    .cm-fields { flex-direction: column; }
    .cm-children { margin-left: 8px; padding-left: 10px; }
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 1024px) {
    .sidebar-column { width: 280px; }
}

@media (max-width: 767px) {
    :root { --categories-height: 0px; }

    html, body { overflow-x: hidden; }

    .topbar { height: var(--topbar-height); }
    .categories-container,
    .topbar-divider { display: none; }

    .topbar-search { top: var(--topbar-height); }

    main { padding-top: calc(var(--topbar-height) + 16px); }

    .content-wrapper { flex-direction: column; }
    .sidebar-column { width: 100%; }

    .topbar-nav { display: none; }
    #menuBtn { display: flex; }
    .topbar-logo { margin-left: 4px; }
    .topbar-logo-text { font-size: 18px; }

    .carousel-inner { padding-bottom: 56%; }

    .article-list-tabs { overflow-x: auto; white-space: nowrap; padding: 0 12px 12px; }
    .article-list-tabs-left { flex-shrink: 0; }
    .article-list-tabs-right { flex-shrink: 0; }

    .article-item-thumbnail { width: 120px; height: 80px; }
    .article-item-title { font-size: 14px; }
    .article-item-excerpt { -webkit-line-clamp: 1; }
    .article-item-date, .article-item-views, .article-item-comments { font-size: 11px; }

    .article-list-cards { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
    .article-card-thumbnail { height: 160px; }

    .article-header { min-height: 200px; border-radius: 0; margin: -16px -16px 16px; }
    .article-header-title { font-size: 22px; }
    .article-header-content { padding: 32px 16px 12px; }

    .article-nav-row { flex-direction: column; }

    .footer { padding: 12px 0; }
    .footer-main { flex-direction: column; gap: 8px; align-items: flex-start; }
    .footer-info { flex-direction: column; gap: 4px; }

    .search-card { padding: 0; }
}
