/* === 变量与基础 === */
:root {
    --bg-body: #f5f6fa;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --text-dark: #1a1a2e;
    --text-mid: #4a4a6a;
    --text-light: #8e8ea0;
    --accent: #4f6ef7;
    --accent-light: #eef1ff;
    --accent-soft: #f0f4ff;
    --border: #e8ecf1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === 导航 === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-img { height: 34px; width: auto; }
.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.nav-menu {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-mid);
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}
.nav-link:hover {
    color: var(--accent);
    background: var(--accent-soft);
}
.nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
    font-weight: 600;
}

.header-actions { flex-shrink: 0; }
.search-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.1);
}
.search-input {
    padding: 9px 14px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-dark);
    width: 180px;
}
.search-input::placeholder { color: var(--text-light); }
.search-btn {
    padding: 9px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
}
.search-btn:hover { color: var(--accent); }

/* === Hero === */
.hero-section {
    background: linear-gradient(160deg, #f8faff 0%, #eef3ff 40%, #f5f6fa 100%);
    padding: 60px 0 70px;
}
.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}
.hero-text { flex: 1; max-width: 520px; }
.hero-label {
    display: inline-block;
    padding: 5px 14px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 18px;
}
.hero-title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-dark);
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}
.hero-desc {
    font-size: 16px;
    color: var(--text-mid);
    margin-bottom: 28px;
    line-height: 1.6;
}
.hero-buttons { display: flex; gap: 12px; }
.btn-primary {
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: #3d5ce5; transform: translateY(-1px); }
.btn-secondary {
    padding: 12px 28px;
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--border);
    transition: border-color 0.2s, transform 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-1px); }

.hero-visual {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-end;
    max-width: 440px;
}
.hero-card {
    background: var(--bg-white);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    transition: transform 0.2s;
}
.hero-card:hover { transform: translateY(-3px); }
.hero-card-icon { font-size: 22px; }
.hero-card-1 { transform: rotate(-2deg); }
.hero-card-2 { transform: rotate(1deg); margin-top: 10px; }
.hero-card-3 { transform: rotate(-1deg); }
.hero-card-1:hover { transform: rotate(-2deg) translateY(-3px); }
.hero-card-2:hover { transform: rotate(1deg) translateY(-3px); }
.hero-card-3:hover { transform: rotate(-1deg) translateY(-3px); }

/* === 内容区块 === */
.main-content { padding: 50px 0 60px; }
.section-block { margin-bottom: 50px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}
.section-more {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
    transition: opacity 0.2s;
}
.section-more:hover { opacity: 0.7; }

/* 分类行 */
.category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    transition: all 0.2s;
}
.category-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.category-name { font-weight: 500; color: var(--text-dark); }
.category-num { font-size: 12px; color: var(--text-light); }

/* 文章网格 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.article-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
}
.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.article-card:hover .article-thumb img { transform: scale(1.04); }
.article-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.9);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}
.article-body { padding: 18px; }
.article-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-title a:hover { color: var(--accent); }
.article-excerpt {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.article-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
}

/* 精选大图 */
.feature-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 240px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-thumb { width: 100%; height: 100%; }
.feature-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.feature-card:hover .feature-thumb img { transform: scale(1.05); }
.feature-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
}
.feature-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}
.feature-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.35;
}
.feature-title a { color: #fff; }
.feature-title a:hover { text-decoration: underline; }
.feature-time { font-size: 12px; opacity: 0.8; }

/* 分页 */
.pagination-wrap {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}
.pagination-wrap a,
.pagination-wrap span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-mid);
    transition: all 0.2s;
}
.pagination-wrap a:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination-wrap .thisclass {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

/* 页脚 */
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 40px 0 30px;
    text-align: center;
}
.footer-info { margin-bottom: 20px; }
.footer-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.footer-desc { font-size: 13px; color: var(--text-light); }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.footer-links a {
    font-size: 14px;
    color: var(--text-mid);
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
    font-size: 12px;
    color: var(--text-light);
}

/* 响应式 */
@media (max-width: 768px) {
    .hero-content { flex-direction: column; text-align: center; }
    .hero-title { font-size: 30px; }
    .hero-visual { justify-content: center; max-width: 100%; }
    .hero-buttons { justify-content: center; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-row { grid-template-columns: 1fr; }
    .feature-card { height: 200px; }
    .nav-menu { gap: 4px; }
    .nav-link { padding: 6px 10px; font-size: 13px; }
    .search-input { width: 120px; }
}
@media (max-width: 480px) {
    .article-grid { grid-template-columns: 1fr; }
    .category-row { justify-content: center; }
    .hero-card { display: none; }
}



/* === 详情页布局 === */
.breadcrumb-wrap {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-light);
}
.breadcrumb-inner a { color: var(--text-mid); transition: color 0.2s; }
.breadcrumb-inner a:hover { color: var(--accent); }
.breadcrumb-inner .sep { margin: 0 8px; color: #ccc; }
.breadcrumb-inner .current { color: var(--text-light); }

.article-wrapper {
    display: flex;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 60px;
    align-items: flex-start;
}

/* 左侧主内容 */
.article-main {
    flex: 1;
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.post-header { margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.post-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-dark);
    margin-bottom: 16px;
}
.post-meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-light); }
.meta-item { display: flex; align-items: center; gap: 6px; }

.post-summary {
    background: var(--accent-soft);
    padding: 16px 20px;
    border-radius: 8px;
    color: var(--text-mid);
    font-size: 15px;
    margin-bottom: 30px;
    border-left: 4px solid var(--accent);
}

/* 正文样式优化 */
.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}
.post-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    color: var(--text-dark);
}
.post-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-dark);
}
.post-content p { margin-bottom: 16px; text-align: justify; }
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}
.post-content ul, .post-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}
.post-content li { margin-bottom: 8px; }

/* 代码块样式 */
.post-content pre {
    background: #f4f6f8;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

/* 标签 */
.post-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.tag-label { font-size: 14px; color: var(--text-light); }
.tag-item {
    padding: 4px 12px;
    background: var(--bg-body);
    color: var(--text-mid);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s;
}
.tag-item:hover { background: var(--accent); color: #fff; }

/* 上下篇导航 */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}
.nav-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--bg-body);
    border-radius: 8px;
    transition: background 0.2s;
    flex: 1;
}
.nav-item:hover { background: var(--accent-soft); }
.nav-label { font-size: 12px; color: var(--text-light); }
.nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 推荐阅读 */
.related-posts { margin-top: 40px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}
.related-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-body);
    border-radius: 8px;
    transition: transform 0.2s;
}
.related-card:hover { transform: translateY(-2px); background: var(--accent-soft); }
.related-card img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; }
.related-card h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 右侧侧边栏 */
.article-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sidebar-box {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.box-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-body);
}

/* 目录列表 */
.toc-list li { margin-bottom: 10px; }
.toc-list a {
    font-size: 14px;
    color: var(--text-mid);
    display: block;
    padding: 4px 0;
    transition: color 0.2s;
}
.toc-list a:hover { color: var(--accent); padding-left: 4px; }

/* 热门列表 */
.hot-list { list-style: none; padding: 0; }
.hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.hot-rank {
    width: 20px;
    height: 20px;
    background: #eee;
    color: #999;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.hot-rank.1 { background: #ff4d4f; color: #fff; }
.hot-rank.2 { background: #ff7a45; color: #fff; }
.hot-rank.3 { background: #ffa940; color: #fff; }
.hot-item a {
    font-size: 14px;
    color: var(--text-dark);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hot-item a:hover { color: var(--accent); }

/* 响应式适配 */
@media (max-width: 900px) {
    .article-wrapper { flex-direction: column; }
    .article-sidebar { width: 100%; order: 2; }
    .article-main { order: 1; padding: 24px; }
    .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .post-title { font-size: 22px; }
    .post-nav { flex-direction: column; }
}