/**
 * 现代化输入框样式
 */

/* 输入表单容器 */
.input-form {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 12px 0;
    border: 1px solid rgba(230, 235, 245, 0.8);
}

/* 文本输入区 */
#txtInput {
    width: 100%;
    min-height: 130px;
    padding: 18px 20px;
    border: none;
    border-radius: 12px 12px 0 0;
    background-color: #fafbfd;
    color: #2d3748;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}

#txtInput:focus {
    background-color: #ffffff;
    box-shadow: inset 0 0 0 2px #4f8aff;
}

#txtInput::placeholder {
    color: #a0aec0;
    font-weight: 300;
}

/* 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 16px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    position: relative;
    gap: 8px;
}

/* 确保方向选择器不重叠显示 */
.toolbar .direction-selector {
    display: none; /* 默认隐藏 */
}

/* 只有当flowchart被选中且为mermaid模式时才显示 */
.toolbar.show-direction .direction-selector {
    display: flex;
}

/* 工具栏中的选择器和按钮 */
.toolbar select {
    padding: 8px 14px;
    background-color: #f5f7fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 36px;
    min-width: 140px;
}

.toolbar select:hover {
    border-color: #cbd5e0;
    background-color: #edf2f7;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.toolbar select:focus {
    border-color: #4f8aff;
    box-shadow: 0 0 0 3px rgba(79, 138, 255, 0.15);
    transform: translateY(-1px);
}

/* 按钮样式 */
.toolbar .btn,
.toolbar .tool-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f7fa;
    color: #4a5568;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.toolbar .btn:hover,
.toolbar .tool-btn:hover {
    background-color: #edf2f7;
    color: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
}

.toolbar .btn.primary {
    background-color: #4f8aff;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(79, 138, 255, 0.25);
}

.toolbar .btn.primary:hover {
    background-color: #3b7bff;
    box-shadow: 0 4px 8px rgba(79, 138, 255, 0.35);
    transform: translateY(-1px);
}

.toolbar .btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(79, 138, 255, 0.25);
}

/* 图标样式 */
.toolbar i {
    font-size: 16px;
    margin-right: 8px;
}

/* 分隔符 */
.toolbar .separator {
    width: 1px;
    height: 28px;
    margin: 0 8px;
    background-color: rgba(226, 232, 240, 0.8);
    align-self: center;
}

/* 选择器组 */
.toolbar .chart-type-selector,
.toolbar .direction-selector,
.toolbar .render-type-selector,
.toolbar .upload-group {
    display: flex;
    align-items: center;
    margin: 0 2px;
    gap: 6px;
}

/* 隐藏重复的方向选择器 */
.toolbar .direction-selector.duplicate {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 10px;
    }
    
    .toolbar select {
        width: 100%;
        min-width: auto;
    }
    
    .toolbar .btn,
    .toolbar .tool-btn {
        width: 100%;
        justify-content: center;
        margin: 3px 0;
    }
    
    .toolbar > div,
    .toolbar > span,
    .toolbar > button {
        margin: 3px 0;
        width: 100%;
    }
    
    .toolbar .separator {
        width: 100%;
        height: 1px;
        margin: 5px 0;
    }
    
    .toolbar .chart-type-selector,
    .toolbar .direction-selector,
    .toolbar .render-type-selector {
        flex-direction: column;
        width: 100%;
    }
}

/* 悬停效果和过渡 */
.input-form:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* 焦点状态 */
.input-form:focus-within {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: rgba(79, 138, 255, 0.3);
}

/* 自定义滚动条 */
#txtInput::-webkit-scrollbar {
    width: 8px;
}

#txtInput::-webkit-scrollbar-track {
    background: #f5f7fa;
    border-radius: 6px;
}

#txtInput::-webkit-scrollbar-thumb {
    background: #c1c9d6;
    border-radius: 6px;
}

#txtInput::-webkit-scrollbar-thumb:hover {
    background: #a3adb9;
}

/* 图片缩略图和公式预览容器的统一样式 */
.thumbnail-container,
.latex-preview-container {
    background-color: #fafbfd;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 0 0 12px 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

/* 缩略图悬停效果 */
.thumbnail-item {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* 上传按钮 */
.upload-group .tool-btn {
    display: flex;
    align-items: center;
    background-color: #f5f7fa;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.upload-group .tool-btn:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
}

/* 拖放状态 */
#txtInput.dragover {
    background-color: rgba(79, 138, 255, 0.05);
    box-shadow: inset 0 0 0 2px #4f8aff;
}

/* 工具栏按钮组 */
.toolbar > div {
    display: flex;
    align-items: center;
} 