/* ==========================================
   CSS 变量 - 支持主题切换
   ========================================== */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --card-bg: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --text-color: #f9fafb;
    --bg-color: #1f2937;
    --card-bg: #374151;
    --border-color: #4b5563;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   基础样式
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* ==========================================
   导航栏
   ========================================== */
.header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
    padding: 0.5rem;
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

/* ==========================================
   英雄区
   ========================================== */
.hero {
    text-align: center;
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

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

.subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ==========================================
   按钮
   ========================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ==========================================
   文章网格
   ========================================== */
.latest-posts {
    padding: 4rem 0;
}

.latest-posts h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 700;
}

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

.post-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.post-category {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.post-date {
    font-size: 0.875rem;
}

.post-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.post-card p {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.read-more:hover {
    color: var(--secondary-color);
}

.view-all {
    text-align: center;
    margin-top: 2rem;
}

/* ==========================================
   页面标题
   ========================================== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 4rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* ==========================================
   博客页面
   ========================================== */
.blog-section {
    padding: 3rem 0;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.search-box {
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: #6b7280;
}

/* ==========================================
   关于页面
   ========================================== */
.about-section {
    padding: 3rem 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-header {
    text-align: center;
    margin-bottom: 3rem;
}

.avatar {
    margin-bottom: 1.5rem;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.about-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.intro {
    font-size: 1.125rem;
    color: #6b7280;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.about-card h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.about-card h3 {
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    font-size: 1rem;
}

.about-card p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.skills {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-category {
    margin-bottom: 1rem;
}

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

.skill-tag {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

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

.philosophy-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.8;
}

.philosophy-list li:last-child {
    border-bottom: none;
}

.contact-info {
    margin-bottom: 1rem;
}

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

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

.contact-info a:hover {
    text-decoration: underline;
}

.contact-note {
    font-style: italic;
    color: #6b7280;
}

/* ==========================================
   文章详情页
   ========================================== */
.post-detail {
    padding: 3rem 0;
}

.post-header {
    margin-bottom: 2rem;
}

.breadcrumb {
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

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

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

.post-detail h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.post-meta-detail {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.separator {
    color: #d1d5db;
}

.post-body {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.post-body h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.post-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-body p {
    margin-bottom: 1rem;
}

.post-body ul,
.post-body ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body code {
    background-color: var(--border-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.post-body pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.post-body pre code {
    background-color: transparent;
    padding: 0;
}

.post-footer {
    margin-top: 2rem;
}

.post-navigation {
    margin-top: 2rem;
    text-align: center;
}

/* ==========================================
   页脚
   ========================================== */
.footer {
    background-color: var(--card-bg);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    margin: 0 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

