/*
Theme Name: TechNotes
Author: Your Name
Description: A clean, minimal tech blog theme.
Version: 1.0
*/

:root {
    /* 亮色模式变量 */
    --bg-body: #f4f5f7;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --accent-color: #3b82f6;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

body.dark-mode {
    /* 暗色模式变量 */
    --bg-body: #111827;
    --bg-card: #1f2937;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--accent-color); }

/* Header */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-weight: 800; font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.logo span { background: #333; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 0.9em;}

.main-nav ul { list-style: none; display: flex; gap: 20px; }
.main-nav a { font-weight: 500; color: var(--text-muted); }
.main-nav a:hover { color: var(--text-main); }

.header-actions { display: flex; gap: 15px; align-items: center; }
.mode-toggle, .mobile-menu-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-main); }
.mobile-menu-btn { display: none; }

/* Layout Grid */
.site-content {
    display: grid;
    grid-template-columns: 2.5fr 1fr; /* 左侧宽，右侧窄 */
    gap: 40px;
    margin-top: 40px;
    margin-bottom: 60px;
}

/* Post Cards */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.post-card:hover { transform: translateY(-3px); }

.post-title { font-size: 1.5rem; margin-bottom: 10px; font-weight: 700; }
.post-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;}
.post-excerpt { color: var(--text-muted); font-size: 1rem; margin-bottom: 20px; }

/* Tags */
.tag-pill {
    background: var(--bg-body);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 8px;
    border: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar-widget {
    background: var(--bg-body); /* 透明或背景色 */
    margin-bottom: 30px;
}
.sidebar-widget h3 { margin-bottom: 15px; font-size: 1.1rem; }
.sidebar-widget ul { list-style: none; }
.sidebar-widget li { margin-bottom: 8px; color: var(--text-muted); }

/* Footer */
.site-footer { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 0.9rem; }

/* ICP备案号 */
.icp-info {
    margin-top: 12px;
    font-size: 0.85rem;
}
.icp-info a {
    color: var(--text-muted);
    text-decoration: none;
}
.icp-info a:hover {
    color: var(--accent-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .site-content { grid-template-columns: 1fr; }
    .main-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg-card); padding: 20px; box-shadow: var(--shadow); }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; text-align: center; }
    .mobile-menu-btn { display: block; }
}

/* =========================================
   Single Post Styles (文章详情页样式)
   ========================================= */

/* 详情页标题大一点 */
.single-title {
    font-size: 2rem;
    margin-bottom: 15px;
}

/* 正文排版优化 */
.entry-content {
    font-size: 1.1rem; /* 正文字体稍微大一点，易读 */
    line-height: 1.8;
    color: var(--text-main);
}

/* 正文内的段落间距 */
.entry-content p {
    margin-bottom: 1.5em;
}

/* 正文内的标题 H2, H3 */
.entry-content h2 { font-size: 1.5rem; margin-top: 1.5em; margin-bottom: 0.8em; font-weight: 700; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.2em; margin-bottom: 0.6em; font-weight: 600; }

/* 正文内的列表 */
.entry-content ul, .entry-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}
.entry-content li { margin-bottom: 0.5em; }

/* 正文内的图片自适应 */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
    box-shadow: var(--shadow);
}

/* 引用块样式 */
.entry-content blockquote {
    border-left: 4px solid var(--accent-color);
    margin: 1.5em 0;
    padding: 10px 20px;
    background: var(--bg-body);
    font-style: italic;
    color: var(--text-muted);
}

/* 表格样式 */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}
.entry-content th, .entry-content td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

