Files
Your Name 6d4368fbd1 Initial commit: TechBlog Pro WordPress theme
Features:
- Modern UI with dark mode support
- Code highlighting with copy button
- Auto table of contents
- Reading time & views counter
- Responsive design
- Admin settings page
- AJAX search
2026-08-18 16:05:14 +08:00

1476 lines
29 KiB
CSS
Executable File

/*
Theme Name: TechBlog Pro
Theme URI: https://github.com/techblog-pro
Author: TechBlog Team
Author URI: https://github.com
Description: 一个专为IT技术分享设计的现代化WordPress主题,支持代码高亮、暗色模式、响应式布局
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techblog
Tags: blog, technology, code, dark-mode, responsive
*/
/* ==================== CSS Variables ==================== */
:root {
/* Light Mode Colors */
--primary-color: #2563eb;
--primary-hover: #1d4ed8;
--secondary-color: #7c3aed;
--accent-color: #06b6d4;
--bg-primary: #ffffff;
--bg-secondary: #f8fafc;
--bg-tertiary: #f1f5f9;
--bg-code: #1e293b;
--text-primary: #1e293b;
--text-secondary: #475569;
--text-muted: #94a3b8;
--text-code: #e2e8f0;
--border-color: #e2e8f0;
--border-hover: #cbd5e1;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--radius-sm: 6px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-xl: 16px;
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
--header-height: 64px;
--sidebar-width: 300px;
--content-max-width: 780px;
--container-max-width: 1280px;
--transition: all 0.2s ease;
}
/* Dark Mode */
[data-theme="dark"] {
--bg-primary: #0f172a;
--bg-secondary: #1e293b;
--bg-tertiary: #334155;
--bg-code: #0d1117;
--text-primary: #f1f5f9;
--text-secondary: #94a3b8;
--text-muted: #64748b;
--text-code: #e2e8f0;
--border-color: #334155;
--border-hover: #475569;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}
/* ==================== Base Styles ==================== */
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 16px;
scroll-behavior: smooth;
scroll-padding-top: calc(var(--header-height) + 20px);
}
body {
font-family: var(--font-sans);
background-color: var(--bg-primary);
color: var(--text-primary);
line-height: 1.7;
transition: background-color 0.3s ease, color 0.3s ease;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
color: var(--primary-color);
text-decoration: none;
transition: var(--transition);
}
a:hover {
color: var(--primary-hover);
}
img {
max-width: 100%;
height: auto;
display: block;
}
/* ==================== Header ==================== */
.site-header {
position: sticky;
top: 0;
z-index: 1000;
background: var(--bg-primary);
border-bottom: 1px solid var(--border-color);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
.header-inner {
max-width: var(--container-max-width);
margin: 0 auto;
padding: 0 24px;
height: var(--header-height);
display: flex;
align-items: center;
justify-content: space-between;
}
.site-logo {
display: flex;
align-items: center;
gap: 10px;
font-size: 1.25rem;
font-weight: 700;
color: var(--text-primary);
}
.site-logo svg {
width: 32px;
height: 32px;
fill: var(--primary-color);
}
/* Navigation */
.main-nav {
display: flex;
align-items: center;
gap: 8px;
}
.main-nav a {
padding: 8px 16px;
color: var(--text-secondary);
font-size: 0.9375rem;
font-weight: 500;
border-radius: var(--radius-sm);
transition: var(--transition);
}
.main-nav a:hover,
.main-nav a.current {
color: var(--text-primary);
background: var(--bg-tertiary);
}
/* Header Actions */
.header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.search-toggle,
.theme-toggle,
.mobile-menu-toggle {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background: none;
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
color: var(--text-secondary);
cursor: pointer;
transition: var(--transition);
}
.search-toggle:hover,
.theme-toggle:hover,
.mobile-menu-toggle:hover {
background: var(--bg-tertiary);
color: var(--text-primary);
border-color: var(--border-hover);
}
.theme-toggle svg,
.search-toggle svg {
width: 20px;
height: 20px;
}
.mobile-menu-toggle {
display: none;
}
/* ==================== Layout ==================== */
.site-container {
max-width: var(--container-max-width);
margin: 0 auto;
padding: 32px 24px;
display: grid;
grid-template-columns: 1fr var(--sidebar-width);
gap: 40px;
}
.content-area {
min-width: 0;
}
/* ==================== Hero Section ==================== */
.hero-section {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
border-radius: var(--radius-xl);
padding: 48px;
margin-bottom: 40px;
color: white;
position: relative;
overflow: hidden;
}
.hero-section::before {
content: '';
position: absolute;
top: 0;
right: 0;
width: 300px;
height: 300px;
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
transform: translate(30%, -30%);
}
.hero-title {
font-size: 2rem;
font-weight: 800;
margin-bottom: 12px;
position: relative;
}
.hero-description {
font-size: 1.0625rem;
opacity: 0.9;
max-width: 600px;
position: relative;
}
/* ==================== Post Cards ==================== */
.posts-grid {
display: grid;
gap: 24px;
}
.post-card {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 28px;
transition: var(--transition);
}
.post-card:hover {
border-color: var(--primary-color);
box-shadow: var(--shadow-md);
transform: translateY(-2px);
}
.post-card-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 16px;
}
.post-category {
display: inline-flex;
align-items: center;
padding: 4px 12px;
background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
color: white;
font-size: 0.75rem;
font-weight: 600;
border-radius: 100px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.post-date {
font-size: 0.875rem;
color: var(--text-muted);
}
.post-card-title {
font-size: 1.375rem;
font-weight: 700;
line-height: 1.4;
margin-bottom: 12px;
color: var(--text-primary);
}
.post-card-title a {
color: inherit;
}
.post-card-title a:hover {
color: var(--primary-color);
}
.post-excerpt {
color: var(--text-secondary);
font-size: 0.9375rem;
line-height: 1.6;
margin-bottom: 20px;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.post-card-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 16px;
border-top: 1px solid var(--border-color);
}
.post-meta {
display: flex;
align-items: center;
gap: 16px;
font-size: 0.875rem;
color: var(--text-muted);
}
.post-meta-item {
display: flex;
align-items: center;
gap: 6px;
}
.post-meta-item svg {
width: 16px;
height: 16px;
}
.read-more {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.875rem;
font-weight: 600;
color: var(--primary-color);
}
.read-more svg {
width: 16px;
height: 16px;
transition: transform 0.2s ease;
}
.read-more:hover svg {
transform: translateX(4px);
}
/* ==================== Single Post ==================== */
.single-post {
width: 100%;
}
/* Post Footer - Tags & Share */
.post-footer {
margin-top: 40px;
padding-top: 32px;
border-top: 1px solid var(--border-color);
}
.post-tags {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 24px;
flex-wrap: wrap;
}
.post-tags svg {
color: var(--text-muted);
flex-shrink: 0;
}
.post-tags a {
display: inline-block;
padding: 6px 14px;
background: var(--bg-secondary);
color: var(--text-secondary);
border-radius: 100px;
font-size: 0.8125rem;
font-weight: 500;
transition: var(--transition);
border: 1px solid var(--border-color);
}
.post-tags a:hover {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
transform: translateY(-1px);
}
.share-section {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 24px;
background: var(--bg-secondary);
border-radius: var(--radius-lg);
border: 1px solid var(--border-color);
}
.share-label {
display: flex;
align-items: center;
gap: 10px;
font-weight: 600;
color: var(--text-primary);
font-size: 0.9375rem;
}
.share-label svg {
color: var(--text-muted);
}
.share-buttons {
display: flex;
gap: 10px;
}
.share-btn {
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
background: var(--bg-primary);
color: var(--text-secondary);
cursor: pointer;
transition: var(--transition);
}
.share-btn:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.share-twitter:hover {
background: #000;
color: white;
border-color: #000;
}
.share-linkedin:hover {
background: #0077b5;
color: white;
border-color: #0077b5;
}
.share-copy:hover {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.share-copy.copied {
background: #22c55e;
color: white;
border-color: #22c55e;
}
/* ==================== Comments Area ==================== */
.comments-area {
margin-top: 48px;
padding-top: 40px;
border-top: 1px solid var(--border-color);
}
.comments-title {
display: flex;
align-items: center;
gap: 12px;
font-size: 1.25rem;
font-weight: 700;
margin-bottom: 32px;
color: var(--text-primary);
}
.comments-title svg {
color: var(--primary-color);
}
.comment-list {
list-style: none;
padding: 0;
margin: 0;
}
.comment-item {
margin-bottom: 24px;
}
.comment-item .children {
list-style: none;
padding-left: 48px;
margin-top: 24px;
}
.comment-body {
display: flex;
gap: 16px;
padding: 24px;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
transition: var(--transition);
}
.comment-body:hover {
border-color: var(--border-hover);
box-shadow: var(--shadow-sm);
}
.comment-avatar {
flex-shrink: 0;
}
.comment-avatar img {
width: 48px;
height: 48px;
border-radius: 50%;
border: 2px solid var(--bg-secondary);
}
.comment-content {
flex: 1;
min-width: 0;
}
.comment-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 10px;
}
.comment-author {
font-weight: 600;
color: var(--text-primary);
font-size: 0.9375rem;
}
.comment-author a {
color: var(--text-primary);
text-decoration: none;
}
.comment-author a:hover {
color: var(--primary-color);
}
.comment-header time {
font-size: 0.8125rem;
color: var(--text-muted);
}
.comment-text {
color: var(--text-secondary);
line-height: 1.7;
font-size: 0.9375rem;
}
.comment-text p:last-child {
margin-bottom: 0;
}
.comment-actions {
margin-top: 12px;
}
.comment-actions a {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.8125rem;
color: var(--text-muted);
font-weight: 500;
padding: 4px 10px;
border-radius: var(--radius-sm);
transition: var(--transition);
}
.comment-actions a:hover {
color: var(--primary-color);
background: rgba(37, 99, 235, 0.05);
}
/* Comment Form */
.comment-form {
margin-top: 40px;
padding: 32px;
background: var(--bg-secondary);
border-radius: var(--radius-xl);
border: 1px solid var(--border-color);
}
.comment-form-group {
margin-bottom: 20px;
}
.comment-form-group label {
display: flex;
align-items: center;
gap: 8px;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 12px;
font-size: 0.9375rem;
}
.comment-form-group label svg {
color: var(--primary-color);
}
.comment-form-group textarea {
width: 100%;
padding: 16px;
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
font-size: 1rem;
font-family: var(--font-sans);
background: var(--bg-primary);
color: var(--text-primary);
resize: vertical;
min-height: 120px;
transition: var(--transition);
}
.comment-form-group textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.comment-form-group textarea::placeholder {
color: var(--text-muted);
}
.comment-form .comment-form-cookies-consent {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 20px;
font-size: 0.875rem;
color: var(--text-secondary);
}
.comment-form .comment-form-cookies-consent input[type="checkbox"] {
width: 18px;
height: 18px;
accent-color: var(--primary-color);
}
.comment-form .submit-btn {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 14px 28px;
background: var(--primary-color);
color: white;
border: none;
border-radius: var(--radius-md);
font-size: 1rem;
font-weight: 600;
font-family: var(--font-sans);
cursor: pointer;
transition: var(--transition);
}
.comment-form .submit-btn:hover {
background: var(--primary-hover);
transform: translateY(-1px);
box-shadow: var(--shadow-md);
}
.comment-form .submit-btn svg {
transition: transform 0.2s ease;
}
.comment-form .submit-btn:hover svg {
transform: translateX(2px) translateY(-2px);
}
.no-comments {
text-align: center;
padding: 32px;
color: var(--text-muted);
font-size: 0.9375rem;
}
.post-header {
margin-bottom: 32px;
padding-bottom: 24px;
border-bottom: 1px solid var(--border-color);
}
.post-header .post-category {
margin-bottom: 16px;
}
.post-title {
font-size: 2.25rem;
font-weight: 800;
line-height: 1.3;
margin-bottom: 16px;
letter-spacing: -0.02em;
}
.post-meta-full {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 20px;
color: var(--text-muted);
font-size: 0.9375rem;
}
.post-meta-full a {
color: var(--text-muted);
}
.post-meta-full a:hover {
color: var(--primary-color);
}
.author-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: 600;
font-size: 1rem;
}
/* ==================== Post Content ==================== */
.post-content {
font-size: 1.0625rem;
line-height: 1.8;
color: var(--text-primary);
}
.post-content h2 {
font-size: 1.75rem;
font-weight: 700;
margin-top: 48px;
margin-bottom: 20px;
padding-bottom: 12px;
border-bottom: 2px solid var(--border-color);
letter-spacing: -0.01em;
}
.post-content h3 {
font-size: 1.375rem;
font-weight: 600;
margin-top: 36px;
margin-bottom: 16px;
}
.post-content h4 {
font-size: 1.125rem;
font-weight: 600;
margin-top: 28px;
margin-bottom: 12px;
}
.post-content p {
margin-bottom: 20px;
}
.post-content a {
color: var(--primary-color);
text-decoration: underline;
text-decoration-color: rgba(37, 99, 235, 0.3);
text-underline-offset: 3px;
}
.post-content a:hover {
text-decoration-color: var(--primary-color);
}
.post-content ul,
.post-content ol {
margin-bottom: 20px;
padding-left: 28px;
}
.post-content li {
margin-bottom: 8px;
}
.post-content li::marker {
color: var(--primary-color);
}
.post-content blockquote {
margin: 24px 0;
padding: 20px 24px;
border-left: 4px solid var(--primary-color);
background: var(--bg-secondary);
border-radius: 0 var(--radius-md) var(--radius-md) 0;
font-style: italic;
color: var(--text-secondary);
}
.post-content blockquote p:last-child {
margin-bottom: 0;
}
.post-content img {
border-radius: var(--radius-md);
margin: 24px 0;
box-shadow: var(--shadow-md);
}
.post-content hr {
border: none;
height: 1px;
background: var(--border-color);
margin: 40px 0;
}
.post-content table {
width: 100%;
border-collapse: collapse;
margin: 24px 0;
font-size: 0.9375rem;
}
.post-content th,
.post-content td {
padding: 12px 16px;
text-align: left;
border: 1px solid var(--border-color);
}
.post-content th {
background: var(--bg-secondary);
font-weight: 600;
color: var(--text-primary);
}
.post-content tr:hover {
background: var(--bg-secondary);
}
/* Inline Code */
.post-content code:not(pre code) {
background: var(--bg-tertiary);
color: var(--secondary-color);
padding: 2px 8px;
border-radius: 4px;
font-family: var(--font-mono);
font-size: 0.875em;
font-weight: 500;
}
/* Code Blocks */
.post-content pre {
background: var(--bg-code);
color: var(--text-code);
padding: 24px;
border-radius: var(--radius-md);
overflow-x: auto;
margin: 24px 0;
position: relative;
font-family: var(--font-mono);
font-size: 0.9375rem;
line-height: 1.6;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.post-content pre code {
background: none;
padding: 0;
color: inherit;
font-size: inherit;
}
.code-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: rgba(0, 0, 0, 0.3);
border-radius: var(--radius-md) var(--radius-md) 0 0;
margin: -24px -24px 16px -24px;
font-size: 0.8125rem;
}
.code-lang {
color: var(--accent-color);
font-weight: 600;
text-transform: uppercase;
}
.copy-btn {
display: flex;
align-items: center;
gap: 6px;
background: none;
border: 1px solid rgba(255, 255, 255, 0.2);
color: rgba(255, 255, 255, 0.6);
padding: 6px 12px;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 0.75rem;
transition: var(--transition);
}
.copy-btn:hover {
background: rgba(255, 255, 255, 0.1);
color: white;
}
.copy-btn svg {
width: 14px;
height: 14px;
}
/* ==================== Table of Contents ==================== */
.toc-container {
position: sticky;
top: calc(var(--header-height) + 32px);
}
.toc {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 24px;
max-height: calc(100vh - var(--header-height) - 64px);
overflow-y: auto;
}
.toc-title {
font-size: 0.875rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-muted);
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 8px;
}
.toc-title svg {
width: 16px;
height: 16px;
}
.toc-list {
list-style: none;
padding: 0;
}
.toc-list li {
margin-bottom: 4px;
}
.toc-list a {
display: block;
padding: 8px 12px;
color: var(--text-secondary);
font-size: 0.875rem;
border-radius: var(--radius-sm);
border-left: 2px solid transparent;
transition: var(--transition);
}
.toc-list a:hover {
color: var(--text-primary);
background: var(--bg-secondary);
}
.toc-list a.active {
color: var(--primary-color);
background: rgba(37, 99, 235, 0.05);
border-left-color: var(--primary-color);
font-weight: 500;
}
.toc-list .toc-h3 {
padding-left: 24px;
font-size: 0.8125rem;
}
/* ==================== Sidebar ==================== */
.sidebar {
position: sticky;
top: calc(var(--header-height) + 32px);
height: fit-content;
}
.sidebar-widget {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 24px;
margin-bottom: 24px;
}
.widget-title {
font-size: 0.875rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-muted);
margin-bottom: 20px;
padding-bottom: 12px;
border-bottom: 2px solid var(--border-color);
}
/* Categories Widget */
.category-list {
list-style: none;
}
.category-list li {
margin-bottom: 8px;
}
.category-list a {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
color: var(--text-secondary);
background: var(--bg-secondary);
border-radius: var(--radius-sm);
font-size: 0.9375rem;
transition: var(--transition);
}
.category-list a:hover {
background: var(--primary-color);
color: white;
}
.category-count {
background: var(--bg-primary);
padding: 2px 10px;
border-radius: 100px;
font-size: 0.75rem;
font-weight: 600;
}
.category-list a:hover .category-count {
background: rgba(255, 255, 255, 0.2);
color: white;
}
/* Tags Widget */
.tag-cloud {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.tag-cloud a {
display: inline-block;
padding: 6px 14px;
background: var(--bg-secondary);
color: var(--text-secondary);
border-radius: 100px;
font-size: 0.8125rem;
transition: var(--transition);
}
.tag-cloud a:hover {
background: var(--primary-color);
color: white;
}
/* Recent Posts Widget */
.recent-posts-list {
list-style: none;
}
.recent-posts-list li {
padding: 16px 0;
border-bottom: 1px solid var(--border-color);
}
.recent-posts-list li:last-child {
border-bottom: none;
padding-bottom: 0;
}
.recent-posts-list li:first-child {
padding-top: 0;
}
.recent-post-title {
display: block;
font-size: 0.9375rem;
font-weight: 500;
color: var(--text-primary);
line-height: 1.4;
margin-bottom: 6px;
}
.recent-post-title:hover {
color: var(--primary-color);
}
.recent-post-date {
font-size: 0.8125rem;
color: var(--text-muted);
}
/* ==================== Pagination ==================== */
.pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-top: 48px;
padding-top: 32px;
border-top: 1px solid var(--border-color);
}
.pagination a,
.pagination span {
display: flex;
align-items: center;
justify-content: center;
min-width: 40px;
height: 40px;
padding: 0 12px;
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
font-size: 0.9375rem;
font-weight: 500;
transition: var(--transition);
}
.pagination a {
color: var(--text-secondary);
}
.pagination a:hover {
background: var(--bg-secondary);
color: var(--text-primary);
border-color: var(--border-hover);
}
.pagination .current {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.pagination .dots {
border: none;
color: var(--text-muted);
}
/* ==================== Search Overlay ==================== */
.search-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(8px);
z-index: 2000;
display: flex;
align-items: flex-start;
justify-content: center;
padding-top: 20vh;
opacity: 0;
visibility: hidden;
transition: var(--transition);
}
.search-overlay.active {
opacity: 1;
visibility: visible;
}
.search-container {
background: var(--bg-primary);
border-radius: var(--radius-xl);
padding: 24px;
width: 90%;
max-width: 640px;
box-shadow: var(--shadow-lg);
transform: translateY(-20px);
transition: transform 0.3s ease;
}
.search-overlay.active .search-container {
transform: translateY(0);
}
.search-input-wrapper {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
background: var(--bg-secondary);
border-radius: var(--radius-md);
border: 2px solid var(--border-color);
transition: var(--transition);
}
.search-input-wrapper:focus-within {
border-color: var(--primary-color);
}
.search-input-wrapper svg {
width: 20px;
height: 20px;
color: var(--text-muted);
flex-shrink: 0;
}
.search-input {
flex: 1;
border: none;
background: none;
font-size: 1.0625rem;
color: var(--text-primary);
outline: none;
}
.search-input::placeholder {
color: var(--text-muted);
}
.search-hint {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 12px;
font-size: 0.8125rem;
color: var(--text-muted);
}
.search-hint kbd {
background: var(--bg-tertiary);
padding: 2px 8px;
border-radius: 4px;
font-family: var(--font-mono);
font-size: 0.75rem;
}
/* ==================== Footer ==================== */
.site-footer {
background: var(--bg-secondary);
border-top: 1px solid var(--border-color);
padding: 48px 24px;
margin-top: 64px;
}
.footer-inner {
max-width: var(--container-max-width);
margin: 0 auto;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 48px;
}
.footer-section h3 {
font-size: 1rem;
font-weight: 600;
margin-bottom: 20px;
color: var(--text-primary);
}
.footer-section p {
color: var(--text-secondary);
font-size: 0.9375rem;
line-height: 1.6;
}
.footer-links {
list-style: none;
}
.footer-links li {
margin-bottom: 10px;
}
.footer-links a {
color: var(--text-secondary);
font-size: 0.9375rem;
}
.footer-links a:hover {
color: var(--primary-color);
}
.footer-bottom {
max-width: var(--container-max-width);
margin: 32px auto 0;
padding-top: 24px;
border-top: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: space-between;
color: var(--text-muted);
font-size: 0.875rem;
}
/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
.site-container {
grid-template-columns: 1fr;
}
.sidebar {
position: static;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 24px;
}
.sidebar-widget {
margin-bottom: 0;
}
.toc-container {
display: none;
}
}
@media (max-width: 768px) {
:root {
--header-height: 56px;
}
.header-inner {
padding: 0 16px;
}
.main-nav {
display: none;
}
.mobile-menu-toggle {
display: flex;
}
.main-nav.active {
display: flex;
flex-direction: column;
position: absolute;
top: var(--header-height);
left: 0;
right: 0;
background: var(--bg-primary);
border-bottom: 1px solid var(--border-color);
padding: 16px;
box-shadow: var(--shadow-md);
}
.main-nav.active a {
padding: 12px 16px;
}
.site-container {
padding: 20px 16px;
gap: 24px;
}
.hero-section {
padding: 32px 24px;
}
.hero-title {
font-size: 1.5rem;
}
.post-card {
padding: 20px;
}
.post-title {
font-size: 1.75rem;
}
.post-content pre {
padding: 16px;
margin-left: -16px;
margin-right: -16px;
border-radius: 0;
}
.sidebar {
grid-template-columns: 1fr;
}
.footer-inner {
grid-template-columns: 1fr;
gap: 32px;
}
.footer-bottom {
flex-direction: column;
gap: 12px;
text-align: center;
}
}
/* ==================== Animations ==================== */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.post-card {
animation: fadeIn 0.5s ease forwards;
}
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.2s; }
.post-card:nth-child(4) { animation-delay: 0.3s; }
/* ==================== Print Styles ==================== */
@media print {
.site-header,
.sidebar,
.toc-container,
.post-card-footer,
.pagination {
display: none !important;
}
.site-container {
grid-template-columns: 1fr;
}
.post-content pre {
white-space: pre-wrap;
word-wrap: break-word;
}
}