/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
}

.navbar-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navbar-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar-links a:hover {
    color: #F0B90B;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #F0B90B, #FFD700);
    color: #1a1a1a;
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

.hero .slogan {
    font-size: 1.3em;
    opacity: 0.9;
}

/* 内容区域 */
.content-wrapper {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}

.main-content {
    flex: 3;
}

.sidebar {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 15px;
    color: #333;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    text-decoration: none;
    color: #555;
    transition: color 0.3s;
}

.category-list a:hover {
    color: #F0B90B;
}

.section-title {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
}

.no-articles {
    color: #999;
    text-align: center;
    padding: 40px;
}

/* 文章卡片 */
.article-list {
    display: grid;
    gap: 20px;
}

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

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

.card-body {
    padding: 20px;
}

.card-body h3 {
    margin-bottom: 10px;
}

.card-body h3 a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.card-body h3 a:hover {
    color: #F0B90B;
}

.card-description {
    color: #666;
    margin-bottom: 15px;
}

.card-meta {
    display: flex;
    gap: 15px;
    color: #999;
    font-size: 0.9em;
}

.card-date, .card-category {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-link {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.page-link:hover {
    background: #F0B90B;
    color: #fff;
    border-color: #F0B90B;
}

.page-link.active {
    background: #F0B90B;
    color: #fff;
    border-color: #F0B90B;
}

/* 文章详情页 */
.article-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.post-content {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-content h1 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    color: #999;
    font-size: 0.9em;
}

.post-body {
    line-height: 1.8;
    color: #444;
}

.post-body p {
    margin-bottom: 15px;
}

/* 页脚 */
.footer {
    background: #1a1a1a;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* 后台管理 */
.admin-container {
    margin: 40px auto;
}

.admin-container h2 {
    margin-bottom: 20px;
}

.message {
    padding: 10px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.tab-btn {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
}

.tab-btn.active, .tab-btn:hover {
    background: #F0B90B;
    color: #fff;
    border-color: #F0B90B;
}

.tab-content {
    display: none;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

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

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

.article-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.article-table tr:hover {
    background: #f5f5f5;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9em;
}

.btn-primary {
    background: #F0B90B;
    color: #fff;
}

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

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

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

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8em;
}

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

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

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #F0B90B;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #F0B90B, #FFD700);
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: block;
    margin: 0 auto 20px;
    height: 50px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-bottom: 15px;
}

/* AI预览 */
.ai-preview {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ai-preview h4 {
    margin-bottom: 15px;
    color: #333;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    .hero h1 {
        font-size: 2em;
    }
    .navbar-links {
        gap: 10px;
    }
    .post-content {
        padding: 20px;
    }
}