/* ============================================================
   AI金融计算器 - 博客样式
   ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    overflow-x: hidden;
}

.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 420px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

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

/* ── 博客主体布局 ── */
.blog-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    margin-bottom: 40px;
}

/* ── 文章列表 ── */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    background: white;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.article-date {
    font-size: 0.82rem;
    color: #999;
}

.article-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-excerpt {
    font-size: 0.92rem;
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.article-tag {
    font-size: 0.78rem;
    color: #667eea;
    background: #f0f2ff;
    padding: 3px 10px;
    border-radius: 6px;
}

.read-more {
    font-size: 0.88rem;
    color: #667eea;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── 侧边栏 ── */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #f8f9fa;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    opacity: 0.5;
}

/* 分类列表 */
.category-list {
    list-style: none;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:hover {
    color: #667eea;
}

.category-item:hover .category-count {
    background: #667eea;
    color: white;
}

.category-name {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-count {
    font-size: 0.78rem;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    transition: all 0.2s;
}

/* 热门文章 */
.popular-list {
    list-style: none;
    counter-reset: popular;
}

.popular-item {
    counter-increment: popular;
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s;
}

.popular-item:last-child {
    border-bottom: none;
}

.popular-item:hover {
    transform: translateX(4px);
}

.popular-item::before {
    content: counter(popular);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.popular-item:nth-child(1)::before {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.popular-item:nth-child(2)::before {
    background: linear-gradient(135deg, #ffa502, #ff7f50);
}

.popular-item:nth-child(3)::before {
    background: linear-gradient(135deg, #70a1ff, #5f27cd);
}

.popular-title {
    font-size: 0.88rem;
    color: #333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-item:hover .popular-title {
    color: #667eea;
}

.popular-views {
    font-size: 0.75rem;
    color: #bbb;
    margin-top: 4px;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 6px 12px;
    background: #f0f2ff;
    color: #667eea;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-item:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
}

/* ── 文章详情页 ── */
.article-detail {
    background: white;
    border-radius: 18px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #764ba2;
}

.breadcrumb-sep {
    color: #ddd;
}

.breadcrumb-current {
    color: #666;
}

.article-.article-.article-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.author-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.publish-time {
    font-size: 0.85rem;
    color: #999;
}

.article-stats {
    display: flex;
    gap: 16px;
    margin-left: auto;
}

.stat-item {
    font-size: 0.82rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 文章内容 */
.article-content {
    font-size: 0.95rem;
    line-height: 1.9;
    color: #333;
}

.article-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 32px 0 16px;
    padding-left: 14px;
    border-left: 4px solid #667eea;
}

.article-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 24px 0 12px;
}

.article-content p {
    margin-bottom: 16px;
    text-align: justify;
}

.article-content strong {
    color: #667eea;
    font-weight: 600;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.article-content blockquote {
    background: linear-gradient(135deg, #f0f2ff, #f8f0ff);
    border-left: 4px solid #667eea;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 10px 10px 0;
    color: #555;
}

.article-content blockquote p {
    margin-bottom: 0;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.data-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tr:nth-child(even) {
    background: #f8f9fa;
}

.data-table tr:hover {
    background: #f0f2ff;
}

/* 案例卡片 */
.case-card {
    background: linear-gradient(135deg, #f0f2ff, #f8f0ff);
    border-radius: 14px;
    padding: 24px;
    margin: 20px 0;
    border: 1px solid #e0e5ff;
}

.case-title {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.case-content {
    font-size: 0.92rem;
    line-height: 1.8;
    color: #444;
}

.case-content p {
    margin-bottom: 10px;
}

.case-content p:last-child {
    margin-bottom: 0;
}

.highlight-box {
    background: linear-gradient(135deg, #fff5f5, #fff0f0);
    border: 1px solid #ffd4d4;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0;
}

.highlight-box.green {
    background: linear-gradient(135deg, #f0fff4, #edfff7);
    border-color: #b8e6c9;
}

.highlight-title {
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.highlight-box.green .highlight-title {
    color: #27ae60;
}

.highlight-content {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
}

/* 文章底部标签 */
.article-tags-bottom {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tags-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

/* 相关推荐 */
.related-section {
    background: white;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.related-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.related-card:hover {
    background: white;
    border-color: #e0e5ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.1);
}

.related-cat {
    font-size: 0.75rem;
    color: #667eea;
    background: #f0f2ff;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 10px;
}

.related-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
}

.related-card:hover h3 {
    color: #667eea;
}

.related-desc {
    font-size: 0.82rem;
    color: #999;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 评论区占位 */
.comment-section {
    background: white;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    margin-bottom: 40px;
}

.comment-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.comment-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.comment-placeholder h3 {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 8px;
}

.comment-placeholder p {
    font-size: 0.88rem;
    color: #aaa;
}

/* ── 页脚 ── */
footer {
    background: linear-gradient(135deg, #4a3f8a 0%, #5a3d7a 100%);
    margin-top: 20px;
    padding: 0 20px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 36px 0 28px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.footer-brand {
    color: white;
    flex-shrink: 0;
}

.footer-logo {
    font-size: 1.3rem;
    font-weight: 700;
}

.footer-brand p {
    color: rgba(255,255,255,0.55);
    font-size: 0.88rem;
    margin-top: 6px;
    white-space: nowrap;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin-left: 40px;
}

.footer-links h4 {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 4px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 0 32px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}

/* ── 响应式 ── */
@media (max-width: 968px) {
    .blog-main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .article-card {
        padding: 20px;
    }

    .article-card h2 {
        font-size: 1.15rem;
    }

    .article-detail {
        padding: 24px;
    }

    .article-.article-content h2 {
        font-size: 1.2rem;
    }

    .related-section,
    .comment-section {
        padding: 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
    }

    .footer-links {
        margin-left: 0;
    }

    .article-stats {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .article-card {
        padding: 16px;
        border-radius: 14px;
    }

    .article-detail {
        padding: 20px;
        border-radius: 14px;
    }

    .article-.article-content {
        font-size: 0.9rem;
    }

    .sidebar-widget {
        padding: 20px;
    }

    .case-card {
        padding: 16px;
    }

    .data-table {
        font-size: 0.82rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}
