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

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.6;
}

/* 布局容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 导航栏样式 */
header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

header a {
    color: #333;
    text-decoration: none;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

header .logo i {
    font-size: 24px;
    color: #000;
}

header .logo h1 {
    font-size: 20px;
    font-weight: bold;
}

header .nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

header .nav-actions button,
header .nav-actions a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background-color: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

header .nav-actions button:hover,
header .nav-actions a:hover {
    background-color: #333;
}

header .nav-actions .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    color: #333;
}

header .nav-actions .user-info img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

header .nav-actions .logout-btn {
    background: none;
    color: #333;
    padding: 0;
}

/* 主内容区样式 */
main {
    padding: 32px 0;
}

/* 搜索框样式 */
.search-container {
    max-width: 500px;
    margin: 0 auto 32px;
}

.search-container .relative {
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 12px 40px;
    border: 1px solid #e0e0e0;
    font-size: 16px;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 文章列表样式 - 改为一行3列 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.article-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    border-color: #333;
}

.article-card h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    line-height: 1.4;
}

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

.article-card p {
    color: #666;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    max-width: 450px;
    width: 100%;
    margin: 0 16px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: bold;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 24px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

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

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

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

.form-group .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group .checkbox-group input[type="checkbox"] {
    width: auto;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #333;
}

.btn-block {
    width: 100%;
}

/* 页脚样式 */
footer {
    background-color: #000;
    color: #fff;
    padding: 32px 0;
    margin-top: 48px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-logo i {
    font-size: 20px;
}

.footer-logo span {
    font-size: 18px;
    font-weight: bold;
}

.footer-links {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-links a {
    color: #ccc;
    font-size: 20px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #333;
    padding-top: 24px;
    width: 100%;
}

/* 编辑器样式 */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background-color: #f9f9f9;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.editor-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: background-color 0.2s ease;
}

.editor-btn:hover {
    background-color: #e0e0e0;
}

.editor-btn.active {
    background-color: #000;
    color: #fff;
}

.editor-content {
    min-height: 300px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    outline: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    header .nav-actions {
        gap: 8px;
    }
    
    header .nav-actions button,
    header .nav-actions a {
        padding: 6px 12px;
        font-size: 12px;
    }
}