/* 自定义样式 */

/* 基础样式 */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* 文章卡片样式 */
.post-card {
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 编辑器样式 */
.CodeMirror {
    min-height: 400px;
    border-radius: 0.375rem;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* 主内容区域底部边距，避免被固定footer遮挡 */
main {
    margin-bottom: 80px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .CodeMirror {
        min-height: 300px;
    }
    
    main {
        margin-bottom: 100px;
    }
}

/* 预览样式 */
#preview-content {
    line-height: 1.6;
}

#preview-content h1,
#preview-content h2,
#preview-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

#preview-content p {
    margin-bottom: 1em;
}

#preview-content ul,
#preview-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

#preview-content code {
    background-color: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
    font-family: 'Courier New', monospace;
}

#preview-content pre {
    background-color: #f3f4f6;
    padding: 1em;
    border-radius: 0.375em;
    overflow-x: auto;
    margin-bottom: 1em;
}

#preview-content pre code {
    background: none;
    padding: 0;
}

/* 按钮样式增强 */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* 模态框动画 */
#config-modal,
#post-modal,
#preview-modal {
    animation: fadeIn 0.2s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 提示消息样式 */
.toast {
    animation: slideIn 0.3s ease forwards, fadeOut 0.3s ease 2.7s forwards;
}

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

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