/* CMS系统样式文件 */
/* ================================ */
/* 全局设置 */
/* ================================ */
html {
    scroll-behavior: smooth;
}

/* ================================ */
/* 全局变量定义 */
/* ================================ */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #3b82f6;
    
    --text-dark: #1e293b;
    --text-gray: #475569;
    --text-light: #94a3b8;
    --text-muted: #cbd5e1;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-light: #f1f5f9;
    --bg-dark: #0f172a;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 布局相关 */
    --navbar-height: 70px;
}

/* ================================ */
/* 深色模式切换按钮 */
/* ================================ */
.theme-toggle {
    margin-left: 1rem;
}

.theme-toggle-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    color: var(--text-gray);
}

.theme-toggle-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.theme-toggle-btn i {
    position: absolute;
    font-size: 1.125rem;
    transition: var(--transition-normal);
}

.theme-toggle-btn .light-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle-btn .dark-icon {
    opacity: 0;
    transform: rotate(180deg);
}

/* 深色模式下的图标切换 */
[data-theme="dark"] .theme-toggle-btn .light-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle-btn .dark-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ================================ */
/* 深色模式样式 */
/* ================================ */
[data-theme="dark"] {
    --text-dark: #f1f5f9;
    --text-gray: #cbd5e1;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-light: #334155;
    --bg-dark: #ffffff;
    
    --border-color: #334155;
    --border-light: #475569;
    --border-dark: #64748b;
}

[data-theme="dark"] body {
    background: var(--bg-primary);
    color: var(--text-dark);
}

[data-theme="dark"] .navbar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .cms-header {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .cms-search {
    background: var(--bg-primary);
}

[data-theme="dark"] .cms-search input {
    color: var(--text-dark);
}

[data-theme="dark"] .cms-search input::placeholder {
    color: var(--text-light);
}

[data-theme="dark"] .category-widget,
[data-theme="dark"] .featured-widget,
[data-theme="dark"] .tags-widget,
[data-theme="dark"] .top-articles,
[data-theme="dark"] .latest-articles,
[data-theme="dark"] .article-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .category-list a:hover,
[data-theme="dark"] .featured-item:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .category-count {
    background: var(--border-color);
    color: var(--text-light);
}

[data-theme="dark"] .view-btn {
    background: var(--bg-light);
    color: var(--text-dark);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background: var(--bg-light);
}

/* ================================ */
/* 深色模式 - 更多组件覆盖 */
/* ================================ */
[data-theme="dark"] .cms-container {
    background: #0f172a;
}

[data-theme="dark"] .article-container {
    background: #0f172a;
}

[data-theme="dark"] .search-container {
    background: #0f172a;
}

[data-theme="dark"] .breadcrumb a {
    color: var(--text-gray);
}

[data-theme="dark"] .breadcrumb a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .breadcrumb .current {
    color: var(--text-dark);
}

[data-theme="dark"] .article-header {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .article-title {
    color: var(--text-dark);
}

[data-theme="dark"] .article-meta span {
    color: var(--text-gray);
}

[data-theme="dark"] .article-meta a {
    color: var(--text-gray);
}

[data-theme="dark"] .article-meta a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .article-summary {
    color: var(--text-gray);
}

[data-theme="dark"] .article-content {
    background: var(--bg-secondary);
    color: var(--text-dark);
}

[data-theme="dark"] .article-content h1,
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .article-content h5,
[data-theme="dark"] .article-content h6 {
    color: var(--text-dark);
}

[data-theme="dark"] .article-content p {
    color: var(--text-gray);
}

[data-theme="dark"] .article-content blockquote {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-gray);
}

[data-theme="dark"] .article-content pre {
    background: #1e293b;
    border-color: var(--border-color);
}

[data-theme="dark"] .article-content code:not([class*="language-"]) {
    background: var(--bg-light);
    color: var(--primary-color);
}

[data-theme="dark"] .article-actions {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .action-btn {
    background: var(--bg-light);
    color: var(--text-dark);
    border-color: var(--border-color);
}

[data-theme="dark"] .action-btn:hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .action-btn.liked {
    background: #dc2626;
    color: white;
}

[data-theme="dark"] .related-articles {
    background: var(--bg-secondary);
}

[data-theme="dark"] .related-articles h3 {
    color: var(--text-dark);
}

[data-theme="dark"] .related-item {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .related-item:hover {
    background: var(--border-color);
}

[data-theme="dark"] .related-content h4 a {
    color: var(--text-dark);
}

[data-theme="dark"] .related-content h4 a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .related-meta {
    color: var(--text-light);
}

[data-theme="dark"] .search-header {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-title {
    color: var(--text-dark);
}

[data-theme="dark"] .search-info p {
    color: var(--text-gray);
}

[data-theme="dark"] .search-input-group input {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-dark);
}

[data-theme="dark"] .search-input-group input::placeholder {
    color: var(--text-light);
}

[data-theme="dark"] .search-input-group button {
    background: var(--primary-color);
}

[data-theme="dark"] .search-input-group button:hover {
    background: var(--primary-dark);
}

[data-theme="dark"] .search-results {
    background: var(--bg-secondary);
}

[data-theme="dark"] .results-header h2 {
    color: var(--text-dark);
}

[data-theme="dark"] .sort-options select {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-dark);
}

[data-theme="dark"] .result-item {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .result-item:hover {
    background: var(--border-color);
}

[data-theme="dark"] .result-title a {
    color: var(--text-dark);
}

[data-theme="dark"] .result-title a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .result-summary {
    color: var(--text-gray);
}

[data-theme="dark"] .result-meta span {
    color: var(--text-light);
}

[data-theme="dark"] .result-meta a {
    color: var(--text-light);
}

[data-theme="dark"] .result-meta a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .no-results {
    background: var(--bg-secondary);
    color: var(--text-dark);
}

[data-theme="dark"] .no-results h3 {
    color: var(--text-dark);
}

[data-theme="dark"] .no-results p {
    color: var(--text-gray);
}

[data-theme="dark"] .search-suggestions {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-suggestions h4 {
    color: var(--text-dark);
}

[data-theme="dark"] .search-suggestions ul li {
    color: var(--text-gray);
}

[data-theme="dark"] .popular-searches h4 {
    color: var(--text-dark);
}

/* 模态框深色模式 */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-title {
    color: var(--text-dark);
}

[data-theme="dark"] .modal-message {
    color: var(--text-gray);
}

[data-theme="dark"] .modal-close {
    color: var(--text-light);
}

[data-theme="dark"] .modal-close:hover {
    color: var(--text-dark);
    background: var(--bg-light);
}

[data-theme="dark"] .modal-btn-primary {
    background: var(--primary-color);
}

[data-theme="dark"] .modal-btn-primary:hover {
    background: var(--primary-dark);
}

[data-theme="dark"] .modal-btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-btn-secondary:hover {
    background: var(--border-color);
}

/* 评论系统深色模式 */
[data-theme="dark"] .comments-section {
    background: var(--bg-secondary);
}

[data-theme="dark"] .comments-section h3 {
    color: var(--text-dark);
}

[data-theme="dark"] .comment-form {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-dark);
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--text-light);
}

[data-theme="dark"] .submit-btn {
    background: var(--primary-color);
}

[data-theme="dark"] .submit-btn:hover {
    background: var(--primary-dark);
}

[data-theme="dark"] .comment-item {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .comment-item:hover {
    background: var(--border-color);
}

[data-theme="dark"] .comment-author {
    color: var(--text-dark);
}

[data-theme="dark"] .comment-date,
[data-theme="dark"] .comment-ip {
    color: var(--text-light);
}

[data-theme="dark"] .comment-content {
    color: var(--text-gray);
}

[data-theme="dark"] .reply-btn {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .reply-btn:hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .cancel-reply {
    color: var(--text-light);
}

[data-theme="dark"] .cancel-reply:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .no-comments {
    color: var(--text-light);
}

/* 深色模式下的标签链接样式 */
[data-theme="dark"] .article-tag {
    background: var(--bg-light);
    color: var(--text-gray);
}

[data-theme="dark"] .article-tag:hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .articles-list .article-tag {
    background: var(--bg-light);
    color: var(--text-gray);
}

[data-theme="dark"] .articles-list .article-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* ================================ */
/* 深色模式 - 分类页面和侧边栏补充 */
/* ================================ */

/* 分类页面深色模式 */
[data-theme="dark"] .category-container {
    background: var(--bg-primary);
}

[data-theme="dark"] .category-header {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .category-title {
    color: var(--text-dark);
}

[data-theme="dark"] .category-description {
    color: var(--text-gray);
}

[data-theme="dark"] .category-stats {
    color: var(--text-light);
}

[data-theme="dark"] .articles-section {
    background: var(--bg-primary);
}

/* 侧边栏深色模式 */
[data-theme="dark"] .article-sidebar {
    background: transparent;
}

[data-theme="dark"] .toc-widget,
[data-theme="dark"] .latest-widget,
[data-theme="dark"] .tags-widget {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .toc-widget h3,
[data-theme="dark"] .latest-widget h3,
[data-theme="dark"] .tags-widget h3 {
    color: var(--text-dark);
    border-color: var(--primary-color);
}

[data-theme="dark"] .toc-content {
    color: var(--text-gray);
}

[data-theme="dark"] .toc-content a {
    color: var(--text-gray);
}

[data-theme="dark"] .toc-content a:hover,
[data-theme="dark"] .toc-content a.active {
    color: var(--primary-color);
    background: var(--bg-light);
}

[data-theme="dark"] .latest-item {
    background: transparent;
}

[data-theme="dark"] .latest-item:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .latest-content h4 a {
    color: var(--text-dark);
}

[data-theme="dark"] .latest-content h4 a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .latest-date {
    color: var(--text-light);
}

[data-theme="dark"] .tags-cloud .tag-item {
    background: var(--bg-light);
    color: var(--text-gray);
    border-color: var(--border-color);
}

[data-theme="dark"] .tags-cloud .tag-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 文章标签深色模式补充 */
[data-theme="dark"] .article-tags {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .article-tags h3 {
    color: var(--text-dark);
}

[data-theme="dark"] .tag-item {
    background: var(--bg-light);
    color: var(--text-gray);
    border-color: var(--border-color);
}

[data-theme="dark"] .tag-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* CMS首页和布局深色模式 */
[data-theme="dark"] .cms-layout {
    background: var(--bg-primary);
}

[data-theme="dark"] .cms-sidebar {
    background: transparent;
}

[data-theme="dark"] .cms-main {
    background: transparent;
}

[data-theme="dark"] .section-header {
    background: transparent;
}

[data-theme="dark"] .section-header h2 {
    color: var(--text-dark);
}

[data-theme="dark"] .view-mode {
    background: transparent;
}

[data-theme="dark"] .view-btn {
    background: var(--bg-light);
    color: var(--text-dark);
    border-color: var(--border-color);
}

[data-theme="dark"] .view-btn.active,
[data-theme="dark"] .view-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 文章列表和网格深色模式 */
[data-theme="dark"] .articles-grid,
[data-theme="dark"] .articles-list {
    background: transparent;
}

[data-theme="dark"] .articles-grid .article-card,
[data-theme="dark"] .articles-list .article-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .articles-grid .article-card:hover,
[data-theme="dark"] .articles-list .article-card:hover {
    background: var(--bg-light);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .articles-grid .article-title a,
[data-theme="dark"] .articles-list .article-title a {
    color: var(--text-dark);
}

[data-theme="dark"] .articles-grid .article-title a:hover,
[data-theme="dark"] .articles-list .article-title a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .articles-grid .article-summary,
[data-theme="dark"] .articles-list .article-summary {
    color: var(--text-gray);
}

[data-theme="dark"] .articles-grid .article-meta,
[data-theme="dark"] .articles-list .article-meta {
    color: var(--text-light);
}

[data-theme="dark"] .articles-grid .article-meta a,
[data-theme="dark"] .articles-list .article-meta a {
    color: var(--text-light);
}

[data-theme="dark"] .articles-grid .article-meta a:hover,
[data-theme="dark"] .articles-list .article-meta a:hover {
    color: var(--primary-color);
}

/* 分页深色模式 */
[data-theme="dark"] .pagination {
    background: transparent;
}

[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span {
    background: var(--bg-secondary);
    color: var(--text-gray);
    border-color: var(--border-color);
}

[data-theme="dark"] .pagination a:hover,
[data-theme="dark"] .pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .pagination .disabled {
    background: var(--bg-light);
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* 搜索高亮深色模式 */
[data-theme="dark"] .search-highlight {
    background: var(--primary-color);
    color: white;
}

/* 评论IP显示深色模式 */
[data-theme="dark"] .comment-ip {
    background: var(--bg-secondary);
    color: var(--text-light);
}

[data-theme="dark"] .reply-info {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-gray);
}

/* ================================ */
/* CMS容器和布局 */
/* ================================ */
.cms-container {
    min-height: calc(100vh - 70px);
    background: var(--bg-light);
    padding: 2rem 0;
}

.cms-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ================================ */
/* CMS首页样式 */
/* ================================ */
.cms-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.cms-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.cms-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.cms-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
}

.cms-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cms-nav h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

.cms-search {
    display: flex;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cms-search form {
    display: flex;
}

.cms-search input {
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    background: transparent;
    width: 300px;
    font-size: 1rem;
}

.cms-search button {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.cms-search button:hover {
    background: var(--primary-dark);
}

.cms-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

.cms-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.category-widget,
.featured-widget,
.tags-widget {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.category-widget h3,
.featured-widget h3,
.tags-widget h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-gray);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.category-list a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.category-count {
    background: var(--border-color);
    color: var(--text-gray);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
}

.featured-articles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-normal);
}

.featured-item:hover {
    background: var(--bg-light);
}

.featured-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.featured-content h4 {
    font-size: 0.875rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.featured-content h4 a {
    color: var(--text-dark);
    text-decoration: none;
}

.featured-content h4 a:hover {
    color: var(--primary-color);
}

.featured-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

.cms-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.top-articles,
.latest-articles {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 600;
}

.view-mode {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem;
    background: var(--bg-light);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* 网格视图下确保文章卡片恢复默认样式 */
.articles-grid .article-card {
    display: block;
    flex-direction: initial;
    height: auto;
    align-items: initial;
    padding: 0;
    gap: initial;
}

.articles-grid .article-image {
    width: 100%;
    height: 200px;
    flex-shrink: initial;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: none;
}

.articles-grid .article-content {
    flex: initial;
    display: block;
    justify-content: initial;
    padding: 1.5rem;
    min-height: auto;
    gap: initial;
}

.articles-grid .article-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    order: initial;
}

.articles-grid .article-summary {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-gray);
    order: initial;
}

.articles-grid .article-meta {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    order: initial;
}

.articles-grid .article-tags {
    margin-top: 0;
    margin-bottom: 0;
    order: initial;
}

.articles-grid .article-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-light);
    color: var(--text-gray);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition-normal);
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.article-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 列表视图下的文章卡片样式 */
.articles-list .article-card {
    display: flex;
    flex-direction: row;
    height: auto;
    align-items: center;
    padding: 1.5rem;
    gap: 1.5rem;
}

.articles-list .article-image {
    width: 160px;
    height: 120px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.articles-list .article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    min-height: auto;
}

.articles-list .article-title {
    font-size: 1.25rem;
    margin-bottom: 0;
    line-height: 1.4;
    font-weight: 600;
}

.articles-list .article-summary {
    -webkit-line-clamp: 2;
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-gray);
}

.articles-list .article-meta {
    margin-bottom: 0;
    font-size: 0.875rem;
    color: var(--text-light);
    order: 3;
}

.articles-list .article-tags {
    margin-top: 0;
    margin-bottom: 0;
    order: 4;
}

.articles-list .article-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-light);
    color: var(--text-gray);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition-normal);
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.articles-list .article-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 移动端列表视图优化 */
@media (max-width: 768px) {
    .articles-list .article-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .articles-list .article-image {
        width: 100%;
        height: 180px;
        border-radius: var(--radius-md);
    }
    
    .articles-list .article-content {
        gap: 0.5rem;
    }
    
    .articles-list .article-title {
        font-size: 1.125rem;
    }
}

.cms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ================================ */
/* 文章卡片样式 */
/* ================================ */
.article-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
}

.article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.article-card-image,
.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-light);
}

.article-card-content,
.article-content {
    padding: 1.5rem;
}

.article-card-title,
.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card-title a,
.article-title a {
    color: inherit;
    text-decoration: none;
}

.article-card-title a:hover,
.article-title a:hover {
    color: var(--primary-color);
}

.article-card-summary,
.article-summary {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta,
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.article-card-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.article-tag {
    padding: 0.25rem 0.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

/* ================================ */
/* 文章详情页样式 */
/* ================================ */
.article-container {
    min-height: calc(100vh - 70px);
    background: var(--bg-light);
    padding: 2rem 0;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.article-main {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* 面包屑导航 */
.breadcrumb {
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    color: var(--text-light);
}

.breadcrumb .current {
    color: var(--text-gray);
}

/* 文章头部 */
.article-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.article-meta a:hover {
    text-decoration: underline;
}

.article-summary {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.article-cover {
    margin-bottom: 1.5rem;
}

.article-cover img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* 文章内容 */
.article-content {
    padding: 2rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 2rem 0 1rem 0;
    color: var(--text-dark);
    font-weight: 600;
}

.article-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.25rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    font-style: italic;
}

/* 代码块样式 */
.article-content pre {
    position: relative;
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.article-content pre[class*="language-"] {
    background: #2d3748;
    padding: 0;
    margin: 1.5rem 0;
}

.article-content pre[class*="language-"] code {
    background: transparent;
    padding: 1rem;
    border-radius: 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    display: block;
}

.article-content code:not([class*="language-"]) {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    color: #e53e3e;
    border: 1px solid var(--border-color);
}

/* Prism.js 行号样式 */
.line-numbers .line-numbers-rows {
    border-right: 1px solid #4a5568;
}

.line-numbers-rows > span:before {
    color: #718096;
}

/* 自定义代码工具栏样式 */
.code-toolbar-custom {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 10;
}

.article-content pre:hover .code-toolbar-custom {
    opacity: 1;
}

.language-label {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    user-select: none;
}

.copy-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background var(--transition-normal);
    user-select: none;
}

.copy-button:hover {
    background: var(--primary-dark);
}

/* ================================ */
/* 文章标签 */
/* ================================ */
.article-tags {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.article-tags h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    color: var(--text-gray);
    text-decoration: none;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
}

.tag-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* ================================ */
/* 文章操作按钮 */
/* ================================ */
.article-actions {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-light);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-gray);
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    font-size: 0.875rem;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.action-btn.liked {
    background: var(--primary-color);
    color: white;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ================================ */
/* 相关文章样式 */
/* ================================ */
.related-articles {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-articles h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.related-list {
    display: grid;
    gap: 1rem;
}

.related-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.related-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.related-image {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.related-content {
    flex: 1;
    min-width: 0;
}

.related-content h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.related-content h4 a {
    color: var(--text-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-content h4 a:hover {
    color: var(--primary-color);
}

.related-meta {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ================================ */
/* 侧边栏样式 */
/* ================================ */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 减少组件间距 */
    position: sticky;
    top: calc(var(--navbar-height) + 2rem); /* 导航栏高度 + 间距 */
    align-self: flex-start;
    /* 移除高度限制和滚动条，让内容自然显示 */
}

.toc-widget,
.latest-widget,
.tags-widget {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.toc-widget h3,
.latest-widget h3,
.tags-widget h3 {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* 目录样式 */
.toc-content {
    font-size: 0.875rem;
    max-height: 300px; /* 限制目录最大高度 */
    overflow-y: auto;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.toc-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.toc-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-content li {
    margin-bottom: 0.25rem; /* 减少间距 */
}

.toc-content a {
    color: var(--text-gray);
    text-decoration: none;
    display: block;
    padding: 0.375rem 0; /* 减少内边距 */
    border-left: 3px solid transparent;
    padding-left: 1rem;
    transition: var(--transition-normal);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    scroll-behavior: smooth;
    font-size: 0.8rem; /* 稍微减小字体 */
    line-height: 1.3;
}

.toc-content a:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: var(--bg-light);
}

.toc-content a.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: var(--bg-light);
    font-weight: 600;
}

/* 最新文章样式 */
.latest-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* 减少间距 */
}

.latest-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem; /* 减少内边距 */
    border-radius: var(--radius-md);
    transition: background var(--transition-normal);
}

.latest-item:hover {
    background: var(--bg-light);
}

.latest-image {
    width: 45px; /* 稍微减小图片 */
    height: 45px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.latest-content {
    flex: 1;
    min-width: 0;
}

.latest-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.8rem; /* 减小字体 */
    line-height: 1.3;
}

.latest-content h4 a {
    color: var(--text-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-content h4 a:hover {
    color: var(--primary-color);
}

.latest-date {
    font-size: 0.7rem; /* 减小日期字体 */
    color: var(--text-light);
}

/* 标签云样式 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem; /* 减少间距 */
}

.tags-cloud .tag-item {
    font-size: 0.7rem; /* 减小字体 */
    padding: 0.2rem 0.6rem; /* 减少内边距 */
}

/* ================================ */
/* 评论区样式 */
/* ================================ */
.comments-section {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.comments-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.comment-form {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background var(--transition-normal);
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comments-list {
    max-height: none;
}

.comment-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow var(--transition-normal);
}

.comment-item:hover {
    box-shadow: var(--shadow-md);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.comment-ip {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

.reply-btn {
    font-size: 0.75rem;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
}

.reply-btn:hover {
    background: var(--bg-light);
}

.reply-info {
    background: var(--bg-light);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.cancel-reply {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
}

.cancel-reply:hover {
    color: var(--primary-dark);
}

.comment-content {
    color: var(--text-dark);
    line-height: 1.6;
    word-wrap: break-word;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* ================================ */
/* 模态框样式 */
/* ================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-icon.success {
    color: var(--success-color);
}

.modal-icon.error {
    color: var(--danger-color);
}

.modal-icon.warning {
    color: var(--warning-color);
}

.modal-icon.info {
    color: var(--info-color);
}

.modal-message {
    font-size: 1rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 1rem 2rem 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.modal-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    min-width: 100px;
}

.modal-btn-primary {
    background: var(--primary-color);
    color: white;
}

.modal-btn-primary:hover {
    background: var(--primary-dark);
}

.modal-btn-secondary {
    background: var(--bg-light);
    color: var(--text-gray);
    border: 1px solid var(--border-color);
}

.modal-btn-secondary:hover {
    background: var(--border-color);
}

/* ================================ */
/* 分类页面样式 */
/* ================================ */
.category-container {
    min-height: calc(100vh - 70px);
    background: var(--bg-light);
    padding: 2rem 0;
}

.category-header {
    background: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.category-description {
    font-size: 1.125rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.category-stats {
    color: var(--text-light);
    font-size: 0.875rem;
}

.articles-section {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ================================ */
/* 搜索页面样式 */
/* ================================ */
.search-container {
    min-height: calc(100vh - 70px);
    background: var(--bg-light);
    padding: 2rem 0;
}

.search-header {
    background: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.search-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.search-info {
    margin-bottom: 2rem;
    color: var(--text-gray);
}

.search-info p {
    margin-bottom: 0.5rem;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.search-input-group input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
}

.search-input-group button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background var(--transition-normal);
}

.search-input-group button:hover {
    background: var(--primary-dark);
}

.search-results {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 600;
}

.sort-options select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-gray);
    outline: none;
}

.results-list {
    padding: 0 2rem 2rem;
}

.result-item {
    display: flex;
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-child {
    border-bottom: none;
}

.result-image {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-content {
    flex: 1;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.result-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.result-title a:hover {
    color: var(--primary-color);
}

.result-summary {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.result-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.result-meta a:hover {
    text-decoration: underline;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.no-results {
    background: white;
    padding: 4rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.no-results-icon {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.no-results > p {
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.search-suggestions,
.popular-searches {
    max-width: 500px;
    margin: 2rem auto;
    text-align: left;
}

.search-suggestions h4,
.popular-searches h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.search-suggestions ul {
    color: var(--text-gray);
    padding-left: 1.5rem;
}

.search-suggestions li {
    margin-bottom: 0.5rem;
}

.popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-stats {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.search-highlight {
    background: #fff3cd;
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
}

/* ================================ */
/* 分页样式 */
/* ================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span,
.page-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.pagination a:hover,
.pagination .current,
.page-btn:hover,
.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================ */
/* 响应式设计 */
/* ================================ */
@media (max-width: 1024px) {
    .cms-wrapper {
        padding: 0 1.5rem;
    }
    
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .cms-layout {
        grid-template-columns: 1fr;
    }
    
    .cms-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .cms-hero h1 {
        font-size: 2rem;
    }
    
    .cms-hero p {
        font-size: 1rem;
    }
    
    .cms-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cms-search input {
        width: 250px;
    }
    
    .article-sidebar {
        position: static;
        margin-top: 2rem;
        gap: 1.5rem;
        max-height: none;
        overflow-y: visible;
    }
    
    .article-header {
        padding: 1.5rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-meta {
        gap: 1rem;
    }
    
    .article-actions {
        flex-wrap: wrap;
    }
    
    .toc-widget,
    .latest-widget,
    .tags-widget {
        padding: 1rem;
    }
    
    .latest-item {
        padding: 0.5rem;
    }
    
    .latest-image {
        width: 40px;
        height: 40px;
    }
    
    .related-item {
        flex-direction: column;
        text-align: center;
    }
    
    .related-image {
        width: 100%;
        height: 120px;
    }
    
    .comments-section {
        padding: 1rem;
    }
    
    .comment-form {
        padding: 1rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* 模态框响应式 */
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .modal-header {
        padding: 1rem 1.5rem 0.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 0.5rem 1.5rem 1rem;
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
    
    .modal-message {
        font-size: 0.875rem;
    }
    
    .modal-icon {
        font-size: 2.5rem;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .search-input-group button {
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .result-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .result-image {
        width: 100%;
        height: 200px;
    }
    
    .result-meta {
        gap: 0.5rem;
    }
    
    .category-header {
        padding: 2rem 1.5rem;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .search-header {
        padding: 2rem 1.5rem;
    }
    
    .search-title {
        font-size: 2rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .cms-wrapper {
        padding: 0 1rem;
    }
    
    .cms-hero {
        padding: 2rem 0;
    }
    
    .cms-hero h1 {
        font-size: 1.75rem;
    }
    
    .article-card-content {
        padding: 1rem;
    }
    
    .article-header,
    .article-content {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1.25rem;
    }
    
    .breadcrumb {
        padding: 1rem;
    }
}

/* ================================ */
/* 打印样式 */
/* ================================ */
@media print {
    .article-sidebar,
    .article-actions,
    .comments-section,
    .modal-overlay {
        display: none !important;
    }
    
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-main {
        box-shadow: none;
        border: none;
    }
    
    .article-content {
        padding: 0;
    }
    
    .article-content a {
        color: var(--text-dark) !important;
        text-decoration: none !important;
    }
    
    .article-content a:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--text-light);
    }
}
