/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 头部样式 */
.header {
    background: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.header h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.nav .nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

.nav-item {
    margin: 5px 15px;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: #007bff;
    color: #fff;
}

.nav-item a {
    text-decoration: none;
    color: inherit;
}

/* 主内容区域 */
.main {
    min-height: calc(100vh - 200px);
}

/* 文章列表样式 */
.articles-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.article-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
    text-decoration: none;
    display: block;
}

.article-title:hover {
    color: #007bff;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.article-category {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.article-summary {
    color: #555;
    line-height: 1.5;
    white-space: pre-line;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.pagination-btn {
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #0056b3;
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 文章详情页样式 */
.article-detail {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-detail h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.article-detail .article-meta {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.article-detail .article-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-style: italic;
}

.article-content {
    line-height: 1.8;
    margin-bottom: 30px;
    white-space: pre-line;
}

.article-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 管理后台样式 */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.login-form {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
}

.admin-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.article-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* 导入区域样式 */
.import-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px solid #007bff;
}

.import-section h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 进度条样式 */
.import-progress {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
}

.import-results {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.import-summary {
    margin-bottom: 15px;
}

.import-summary .success {
    color: #28a745;
}

.import-summary .error {
    color: #dc3545;
}

.import-errors {
    margin-top: 10px;
}

.import-errors ul {
    margin: 0;
    padding-left: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.articles-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.articles-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.btn {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
    font-size: 14px;
}

.btn:hover {
    background: #0056b3;
    color: #fff;
    text-decoration: none;
}

.btn-primary {
    background: #28a745;
}

.btn-primary:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
}

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: #fff;
    z-index: 1000;
    max-width: 300px;
}

.message.success {
    background: #28a745;
}

.message.error {
    background: #dc3545;
}

/* 底部样式 */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #eee;
    color: #666;
}

.footer .beian {
    font-size: 12px;
    margin: 5px 0;
}

.footer .beian img {
    width: 16px;
    height: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav .nav-list {
        justify-content: center;
    }
    
    .nav-item {
        margin: 5px 8px;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .article-card {
        padding: 15px;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .article-detail {
        padding: 20px;
    }
    
    .article-detail h2 {
        font-size: 1.5rem;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .articles-table {
        font-size: 14px;
    }
    
    .articles-table th,
    .articles-table td {
        padding: 8px;
    }
    
    .admin-actions {
        justify-content: center;
    }
    
    .article-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .nav-item {
        margin: 3px 5px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .article-card {
        padding: 12px;
    }
    
    .article-title {
        font-size: 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .pagination {
        gap: 10px;
    }
    
    .pagination-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .articles-table {
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}