/* ============================================
   卢萌凯个人博客 - 全局样式
   ============================================ */

/* CSS 变量 */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #0ea5e9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    --max-width: 1140px;
    --nav-height: 64px;
}

/* 重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; }

/* ============================================ 导航栏 */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}
.nav-container {
    max-width: var(--max-width);
    margin: 0 auto; padding: 0 24px;
    height: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 700;
    color: var(--primary);
}
.logo-icon { font-size: 20px; }
.nav-links {
    display: flex; align-items: center; gap: 4px;
}
.nav-link {
    padding: 6px 16px; border-radius: 8px;
    font-size: 15px; font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.active { color: var(--primary); background: var(--primary-light); }
.menu-toggle {
    display: none; background: none; border: none;
    font-size: 22px; cursor: pointer; color: var(--text-primary);
}
.mobile-menu {
    display: none; flex-direction: column;
    background: white; border-top: 1px solid var(--border);
    padding: 12px 24px;
}
.mobile-menu.open { display: flex; }
.mobile-link {
    padding: 12px 0; border-bottom: 1px solid var(--border);
    font-size: 16px; color: var(--text-secondary);
}
.mobile-link:last-child { border-bottom: none; }

/* ============================================ 通用 */
.container {
    max-width: var(--max-width);
    margin: 0 auto; padding: 0 24px;
}
.section { padding: 64px 0; }
.section.bg-light { background: var(--bg-white); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-title { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.section-subtitle { font-size: 16px; color: var(--text-secondary); }
.section-more { text-align: center; margin-top: 40px; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 8px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.btn-primary {
    background: var(--primary); color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary {
    background: white; color: var(--primary);
    border-color: var(--primary);
}
.btn-secondary:hover { background: var(--primary-light); }
.btn-outline {
    background: transparent; color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

/* 标签 */
.tag {
    display: inline-block;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 500;
    background: var(--primary-light); color: var(--primary);
    margin: 2px;
}
.card-category {
    display: inline-block;
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}
.card-date, .card-readtime { font-size: 13px; color: var(--text-muted); }

/* ============================================ Hero 区域 */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 50%, #f0f9ff 100%);
    padding: 80px 0 60px;
}
.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 60px;
    position: relative; z-index: 1;
}
.hero-avatar { flex-shrink: 0; }
.avatar-ring {
    width: 160px; height: 160px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 4px;
    box-shadow: 0 8px 32px rgba(99,102,241,0.3);
}
.avatar-placeholder {
    width: 100%; height: 100%; border-radius: 50%;
    background: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 56px; font-weight: 700; color: var(--primary);
}
.avatar-placeholder.large { font-size: 48px; }
.hero-text { flex: 1; }
.hero-greeting { font-size: 18px; color: var(--text-secondary); margin-bottom: 4px; }
.hero-name {
    font-size: 52px; font-weight: 800; color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.hero-title { font-size: 20px; color: var(--text-secondary); margin-bottom: 16px; font-weight: 500; }
.hero-bio { font-size: 16px; color: var(--text-secondary); margin-bottom: 20px; max-width: 480px; }
.hero-skills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.skill-badge {
    padding: 6px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 600;
    background: white; color: var(--primary);
    border: 1.5px solid var(--primary-light);
    box-shadow: var(--shadow-sm);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 背景装饰 */
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bg-circle {
    position: absolute; border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(14,165,233,0.08));
}
.bg-circle.c1 { width: 400px; height: 400px; top: -100px; right: -80px; }
.bg-circle.c2 { width: 250px; height: 250px; bottom: -60px; left: 30%; }
.bg-circle.c3 { width: 150px; height: 150px; top: 40%; right: 20%; }

/* ============================================ 文章卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}
.card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 24px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title {
    font-size: 17px; font-weight: 700; margin-bottom: 10px; line-height: 1.5;
}
.card-title a { color: var(--text-primary); }
.card-title a:hover { color: var(--primary); }
.card-summary { font-size: 14px; color: var(--text-secondary); line-height: 1.7; flex: 1; margin-bottom: 16px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ============================================ 统计区域 */
.stats-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 48px 0;
}
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.stat-item { text-align: center; color: white; }
.stat-icon { font-size: 32px; margin-bottom: 8px; }
.stat-number { font-size: 40px; font-weight: 800; margin-bottom: 4px; }
.stat-label { font-size: 14px; opacity: 0.85; }

/* ============================================ 专注领域 */
.focus-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.focus-card {
    background: white; border-radius: var(--radius);
    padding: 28px 24px; text-align: center;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}
.focus-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.focus-icon { font-size: 40px; margin-bottom: 16px; display: block; }
.focus-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }
.focus-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ============================================ 页面 Hero（内页） */
.page-hero {
    background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 100%);
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--border);
}
.page-title { font-size: 36px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.page-subtitle { font-size: 16px; color: var(--text-secondary); }

/* ============================================ 博客列表 */
.blog-container {
    display: grid; grid-template-columns: 1fr 300px; gap: 40px;
    align-items: start;
}
.blog-card {
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    display: flex; gap: 0;
    margin-bottom: 20px; overflow: hidden;
    transition: all 0.3s;
}
.blog-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.blog-card-left {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 24px 20px; display: flex; align-items: flex-start; justify-content: center;
}
.blog-date-box { text-align: center; color: white; }
.date-day { display: block; font-size: 28px; font-weight: 800; line-height: 1; }
.date-month { display: block; font-size: 13px; opacity: 0.85; margin: 2px 0; }
.date-year { display: block; font-size: 12px; opacity: 0.7; }
.blog-card-right { flex: 1; padding: 20px 24px; }
.blog-card-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.blog-card-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.blog-card-title a { color: var(--text-primary); }
.blog-card-title a:hover { color: var(--primary); }
.blog-card-summary { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }
.blog-card-footer { display: flex; align-items: center; justify-content: space-between; }
.read-more { color: var(--primary); font-size: 14px; font-weight: 600; }
.read-more:hover { color: var(--primary-dark); }

/* 侧边栏 */
.blog-sidebar { position: sticky; top: calc(var(--nav-height) + 24px); }
.sidebar-widget {
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border); padding: 20px;
    margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.widget-title {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}
.category-list { }
.category-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.category-item:last-child { border-bottom: none; }
.cat-name { color: var(--text-secondary); }
.cat-count {
    background: var(--primary-light); color: var(--primary);
    padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.cloud-tag { cursor: default; }
.sidebar-author { display: flex; align-items: center; gap: 12px; }
.sidebar-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.sidebar-avatar.large { width: 72px; height: 72px; font-size: 28px; margin: 0 auto; }
.sidebar-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sidebar-bio { font-size: 13px; color: var(--text-secondary); }

/* ============================================ 关于页面 */
.about-container {
    display: grid; grid-template-columns: 280px 1fr; gap: 40px;
    align-items: start;
}
.profile-card {
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border); padding: 28px 20px;
    text-align: center; box-shadow: var(--shadow-sm);
    position: sticky; top: calc(var(--nav-height) + 24px);
}
.profile-avatar { margin-bottom: 16px; }
.profile-avatar .avatar-placeholder {
    width: 100px; height: 100px; border-radius: 50%;
    margin: 0 auto; font-size: 40px;
    background: var(--primary-light); color: var(--primary);
}
.profile-name { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.profile-title { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.profile-meta { margin-bottom: 20px; }
.meta-item {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 14px; color: var(--text-secondary); margin-bottom: 8px;
}
.meta-item a { color: var(--primary); }
.meta-icon { font-size: 16px; }
.profile-skills h4 {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 10px; text-align: left;
}
.skills-wrap { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }

.about-main { }
.about-block {
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border); padding: 28px;
    margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.about-block-title {
    font-size: 20px; font-weight: 700; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 2px solid var(--primary-light);
}
.about-block p { font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 10px; }
.about-block p:last-child { margin-bottom: 0; }

/* 时间线 */
.timeline { position: relative; }
.timeline::before {
    content: ''; position: absolute; left: 14px; top: 6px; bottom: 6px;
    width: 2px; background: var(--primary-light);
}
.timeline-item { display: flex; gap: 20px; margin-bottom: 28px; position: relative; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 3px solid white; box-shadow: 0 0 0 2px var(--primary-light);
    z-index: 1;
}
.timeline-content h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.timeline-period { font-size: 13px; color: var(--primary); margin-bottom: 8px; font-weight: 600; }
.timeline-content p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* 擅长领域 */
.expertise-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.expertise-item {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px; border-radius: 8px; background: var(--bg-light);
}
.expertise-icon { font-size: 24px; flex-shrink: 0; }
.expertise-item h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.expertise-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.contact-links { display: flex; gap: 12px; margin-top: 16px; }

/* ============================================ 文章详情 */
.post-hero {
    background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 100%);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border);
}
.post-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
}
.post-breadcrumb a { color: var(--primary); }
.post-breadcrumb a:hover { text-decoration: underline; }
.post-meta-top { margin-bottom: 12px; }
.post-title { font-size: 34px; font-weight: 800; margin-bottom: 16px; line-height: 1.3; }
.post-info {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.post-author { display: flex; align-items: center; gap: 12px; }
.post-author-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px; font-weight: 700;
}
.post-author-name { font-size: 15px; font-weight: 600; display: block; }
.post-date { font-size: 13px; color: var(--text-muted); }
.post-readtime { font-size: 14px; color: var(--text-muted); }
.post-summary {
    font-size: 16px; color: var(--text-secondary); line-height: 1.7;
    margin-bottom: 16px; padding: 16px; border-left: 4px solid var(--primary);
    background: var(--primary-light); border-radius: 0 8px 8px 0;
}

.post-container {
    display: grid; grid-template-columns: 1fr 280px; gap: 40px;
    align-items: start;
}
.post-content {
    background: white; border-radius: var(--radius);
    border: 1px solid var(--border); padding: 36px;
    box-shadow: var(--shadow-sm); line-height: 1.8;
}
.post-content h3 {
    font-size: 20px; font-weight: 700; margin: 28px 0 12px;
    color: var(--text-primary);
}
.post-content h3:first-child { margin-top: 0; }
.post-content p { font-size: 15px; color: var(--text-secondary); margin-bottom: 14px; }
.post-content ul { padding-left: 0; margin-bottom: 14px; }
.post-content ul li {
    position: relative; padding-left: 20px; margin-bottom: 8px;
    font-size: 15px; color: var(--text-secondary);
}
.post-content ul li::before {
    content: '•'; position: absolute; left: 4px; color: var(--primary); font-weight: 700;
}
.post-content strong { color: var(--text-primary); font-weight: 600; }
.post-footer {
    margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
}
.post-tags-section { margin-bottom: 16px; }
.post-share { text-align: center; color: var(--text-muted); font-size: 14px; }
.post-sidebar { position: sticky; top: calc(var(--nav-height) + 24px); }
.author-widget { display: flex; flex-direction: column; align-items: center; }

/* ============================================ 页脚 */
.footer {
    background: var(--text-primary); color: white;
    padding: 40px 0; margin-top: 0;
}
.footer-container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.footer-desc { font-size: 14px; color: #94a3b8; margin-bottom: 16px; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.footer-links a { color: #94a3b8; font-size: 14px; }
.footer-links a:hover { color: white; }
.footer-copy { font-size: 13px; color: #64748b; }

/* ============================================ 主内容 */
.main-content { min-height: calc(100vh - var(--nav-height) - 140px); }

/* ============================================ 响应式 */
@media (max-width: 960px) {
    .hero-inner { flex-direction: column; text-align: center; gap: 32px; }
    .hero-name { font-size: 40px; }
    .hero-skills { justify-content: center; }
    .hero-actions { justify-content: center; }
    .hero-bio { margin: 0 auto 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .focus-grid { grid-template-columns: 1fr 1fr; }
    .blog-container { grid-template-columns: 1fr; }
    .about-container { grid-template-columns: 1fr; }
    .profile-card { position: static; }
    .post-container { grid-template-columns: 1fr; }
    .post-sidebar { position: static; }
    .expertise-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .navbar { height: auto; }
    .nav-container { height: var(--nav-height); }
    .hero { padding: 48px 0 40px; }
    .hero-name { font-size: 32px; }
    .section { padding: 48px 0; }
    .section-title { font-size: 26px; }
    .cards-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .focus-grid { grid-template-columns: 1fr; }
    .blog-card { flex-direction: column; }
    .blog-card-left { padding: 12px 20px; }
    .blog-date-box { display: flex; align-items: center; gap: 8px; }
    .date-day { font-size: 18px; }
    .post-title { font-size: 24px; }
    .post-content { padding: 20px; }
    .contact-links { flex-direction: column; }
}
