* {
    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;
}

.hidden {
    display: none !important;
}

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

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    color: #2563eb;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-outline {
    background-color: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.btn-outline:hover {
    background-color: #2563eb;
    color: white;
}

/* 主要内容 */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.content {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 文章样式 */
.article-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.article-meta {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.article-content {
    line-height: 1.8;
    margin-bottom: 2rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

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

.modal-content {
    background: white;
    border-radius: 0.5rem;
    padding: 0;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    color: #1f2937;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.close:hover {
    color: #374151;
}

/* 表单样式 */
.form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* 评论区域 */
.comments-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.comments-section h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.comment-form {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.comments-list {
    margin-bottom: 2rem;
}

.comment {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    background: white;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #2563eb;
}

.comment-date {
    color: #6b7280;
    font-size: 0.875rem;
}

.comment-content {
    color: #374151;
    line-height: 1.6;
}

.loading {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1100;
    animation: slideIn 0.3s ease;
}

.toast.error {
    background-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 底部 */
.footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main {
        padding: 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}
