/* AutoCMS 前台样式 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* 导航 */
.navbar {
    padding: 0.8rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0;
}

.category-tab {
    display: inline-block;
    padding: 6px 16px;
    background: white;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.category-tab:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    text-decoration: none;
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* 文章卡片 */
.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

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

.article-image {
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
}

.article-body {
    padding: 16px;
}

.article-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-title a {
    color: #333;
    text-decoration: none;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.article-meta .badge {
    font-size: 11px;
}

/* 文章详情页 */
.article-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    .article-container {
        padding: 20px;
        border-radius: 0;
    }
}

.article-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.article-header .article-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 15px;
    color: #222;
}

.article-header .article-meta {
    justify-content: center;
}

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

.article-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 30px 0 15px;
    color: #222;
}

.article-content p {
    margin-bottom: 1em;
    text-indent: 2em;
}

.article-content img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    object-fit: contain;
    /* 确保图片不超出容器 */
    box-sizing: border-box;
}

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

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    color: #222;
}

/* 文章底部 */
.article-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* 复制按钮 */
.copy-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 10px 24px;
    font-weight: 500;
}

.copy-btn:hover {
    opacity: 0.9;
    color: white;
}

/* 相关推荐 */
.related-articles .card {
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.related-articles .card:hover {
    transform: translateY(-2px);
}

.related-articles .card-title {
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-articles .card-title a {
    color: #333;
    text-decoration: none;
}

.related-articles .card-title a:hover {
    color: var(--primary-color);
}

/* Toast */
.toast {
    border-radius: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 15px;
    }

    .category-tab {
        white-space: nowrap;
    }

    .article-header .article-title {
        font-size: 1.4rem;
    }
}
