/* 博客编辑器样式 - 与网站整体风格保持一致 */

/* 页面容器 */
.blog-write-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

/* 主内容区域 */
.blog-write-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 页面标题区域 */
.blog-write-header {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
}

.blog-write-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.blog-write-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.blog-write-header .subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* 操作按钮区域 */
.blog-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.blog-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.blog-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.blog-actions .btn:hover::before {
    left: 100%;
}

.blog-actions .btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.blog-actions .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
}

.blog-actions .btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.blog-actions .btn-success:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.blog-actions .btn-secondary {
    background: var(--secondary-color);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

.blog-actions .btn-secondary:hover {
    background: #5a6268;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

/* 主编辑区域 */
.blog-edit-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .blog-edit-content {
        grid-template-columns: 2fr 1fr;
    }
}

/* 编辑器卡片 */
.editor-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all 0.3s ease;
}

.editor-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.editor-card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 1.5rem;
    border-bottom: none;
}

.editor-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.editor-card-body {
    padding: 2rem;
}

/* 基本信息表单 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: var(--primary-color);
}

/* 标签输入 */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    min-height: 3rem;
    align-items: center;
    background: white;
    transition: all 0.3s ease;
}

.tags-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.tag-item {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 编辑器标签页 */
.editor-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    margin: -2rem -2rem 2rem -2rem;
}

.editor-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    position: relative;
}

.editor-tab.active {
    color: var(--primary-color);
    background: white;
}

.editor-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.editor-tab:hover:not(.active) {
    color: var(--primary-color);
    background: rgba(44, 62, 80, 0.05);
}

/* 编辑器内容区域 */
.editor-content {
    min-height: 400px;
}

.editor-textarea {
    width: 100%;
    min-height: 400px;
    border: none;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.editor-textarea:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* 预览区域 */
.preview-content {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    min-height: 400px;
    border: 1px solid var(--border-color);
}

/* 侧边栏 */
.sidebar-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.sidebar-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.sidebar-card-header {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.sidebar-card-body {
    padding: 1.5rem;
}

/* 设置选项 */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-weight: 500;
    color: var(--text-color);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .blog-write-container {
        padding: 1rem 0;
    }
    
    .blog-write-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .blog-write-header h1 {
        font-size: 2rem;
    }
    
    .blog-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .blog-actions .btn {
        justify-content: center;
    }
    
    .editor-card-body {
        padding: 1.5rem;
    }
    
    .editor-tabs {
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    }
    
    .editor-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .blog-write-main {
        padding: 0 0.5rem;
    }
    
    .blog-write-header {
        padding: 1rem;
    }
    
    .blog-write-header h1 {
        font-size: 1.75rem;
    }
    
    .editor-card-body {
        padding: 1rem;
    }
    
    .editor-tabs {
        margin: -1rem -1rem 1rem -1rem;
    }
}

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

.blog-write-container > * {
    animation: fadeInUp 0.6s ease-out;
}

.blog-write-container > *:nth-child(2) {
    animation-delay: 0.1s;
}

.blog-write-container > *:nth-child(3) {
    animation-delay: 0.2s;
}

/* 工具栏样式 */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    margin: -2rem -2rem 1rem -2rem;
}

.toolbar-group {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.toolbar-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.toolbar-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-published {
    background: #d1edff;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}