/* 小红书风格的全局样式 */
* {
    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-color: #f8f8f8;
    color: #333;
    line-height: 1.6;
}

/* 头部导航 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #4caf50;
    text-decoration: none;
    margin-right: 40px;
}

.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 80px 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #4caf50;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
}

.search-clear {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    display: none;
    z-index: 10;
    padding: 5px;
}

.search-clear:hover {
    color: #666;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 20px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #4caf50;
}

/* 主要内容区域 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.category-tab {
    padding: 8px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-tab:hover,
.category-tab.active {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

/* 文章网格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 文章卡片 */
.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(45deg, #81c784, #a5d6a7);
}

.article-content {
    padding: 15px;
}

/* 文章详情页面内容区域图片样式 */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 确保富文本编辑器中的图片不会撑开容器 */
.article-content p img,
.article-content div img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.article-category {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.article-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 加载更多按钮 */
.load-more {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 12px 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .logo {
        margin-right: 15px;
    }
    
    .nav-links {
        display: none;
    }
    
    .main-container {
        padding: 15px;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .article-card {
        border-radius: 8px;
    }
    
    .article-image {
        height: 150px;
    }
    
    .article-content {
        padding: 12px;
    }
    
    .article-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .search-box {
        max-width: none;
    }
    
    .category-tabs {
        margin-bottom: 20px;
    }
    
    .articles-grid {
        gap: 10px;
    }
    
    .article-image {
        height: 120px;
    }
    
    .article-content {
        padding: 10px;
    }
}

/* 文章详情页样式 */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.article-header {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.article-detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-detail-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.article-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.article-detail-content {
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #f8f8f8;
    border: none;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #4caf50;
    color: #fff;
    text-decoration: none;
}

/* 后台管理样式 */
.admin-header {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: #fff;
    padding: 20px 0;
    margin-bottom: 30px;
}

.admin-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #4caf50;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
    text-decoration: none;
}

.admin-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.article-list {
    overflow-x: auto;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
}

.article-table th,
.article-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.article-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: #666;
}

.status-published {
    color: #4caf50;
    font-weight: 600;
}

.status-draft {
    color: #ff9800;
    font-weight: 600;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    margin-right: 5px;
    transition: all 0.3s;
}

.btn-edit {
    background: #2196f3;
    color: #fff;
}

.btn-edit:hover {
    background: #1976d2;
    text-decoration: none;
    color: #fff;
}

.btn-view {
    background: #4caf50;
    color: #fff;
}

.btn-view:hover {
    background: #388e3c;
    text-decoration: none;
    color: #fff;
}

/* 表单样式 */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #4caf50;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-checkbox {
    margin-right: 8px;
}

.btn-primary {
    background: #4caf50;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #388e3c;
}

.btn-secondary {
    background: #f8f8f8;
    color: #666;
    padding: 12px 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #e0e0e0;
    text-decoration: none;
    color: #666;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
}

.slug-preview {
    margin-top: 5px;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}